How to transition from JIRA Metadata - View project metadata fields to Workflow Postfunctions

This page focuses on the following use case.

Up to version 5.0, the metadata of a project was displayed by using “JIRA Metadata - View project metadata field“ at some Jira issues.

You want to change it to “Text Field (single line)” in your role as Jira Administrator.

Example: In the project there is the metadata SAP cost center and this should be displayed in the activity.

New Text Field (single line) and Workflow Postfunction

First we need to create a new field and fill it automatically when the user creates a Jira issue.

For new Jira issues, the cost center is now transferred from the project.

Transfer the metadata value for existing issues

  1. Search for all issues to which existing metadata should be transferred.

    In the url there is a parameter jql remember/copy this parameter.

  2. Identify the Id of the newly created field. In our example it is customfield_10510

  3. Invoke the following URL

    1. YOUR_SERVER_URL/rest/metadata/1.0/admin/copyProjectMetadata?metadataKey=SAP%20cost%20center&max=100&fieldId=customfield_10510&jql=THE_COPIED_JQL
      e.g. YOUR_SERVER_URL/rest/metadata/1.0/admin/copyProjectMetadata?metadataKey=SAP%20cost%20center&max=100&fieldId=customfield_10510&jql=project%20%3D%20"Test%20Core%20Std%20Fields"%20AND%20"SAP%20cost%20center"%20is%20EMPTY

As you can see here, the metadata value has been transferred.