Automation rule|Update Team field via automation rule

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Copy the value of Team Field type from one issue to another list (single) field type to Team Field type via automation rule.

Solution

Below is the step to copy the team field from Story to Epic:

Step to copy Team field from Story to Epic

Here is Json of the automation rule:

1 {"rules":[{"id":1541496,"clientKey":"ec0d9193-553e-3ba6-b37f-acc49e7bf206","name":"Story copy Epic Team","state":"DISABLED","description":null,"authorAccountId":"5a1a0bb2c51854164d6516ef","actor":{"type":"ACCOUNT_ID","value":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"},"created":1611231688825,"updated":1611326235247,"trigger":{"id":"32046877","component":"TRIGGER","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.manual.trigger.issue","value":{"groups":[]},"children":[],"conditions":[]},"components":[{"id":"32046878","component":"CONDITION","parentId":null,"conditionParentId":null,"schemaVersion":3,"type":"jira.issue.condition","value":{"selectedField":{"type":"ID","value":"issuetype"},"selectedFieldType":"issuetype","comparison":"EQUALS","compareValue":{"type":"ID","modifier":null,"value":"10000","multiValue":false,"source":null}},"children":[],"conditions":[]},{"id":"32046879","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":10,"type":"jira.issue.create","value":{"operations":[{"field":{"type":"ID","value":"summary"},"fieldType":"summary","type":"SET","value":"TEST"},{"field":{"type":"ID","value":"description"},"fieldType":"description","type":"SET","value":null},{"field":{"type":"ID","value":"project"},"fieldType":"project","type":"SET","value":{"value":"current","type":"COPY"}},{"field":{"type":"ID","value":"issuetype"},"fieldType":"issuetype","type":"SET","value":{"type":"ID","value":"10001"}},{"field":{"type":"NAME","value":"Epic Link"},"fieldType":"com.pyxis.greenhopper.jira:gh-epic-link","type":"SET","value":{"type":"COPY","value":"current"}}],"advancedFields":"{\n \"fields\": {\n \"customfield_10001\" : \"{{issue.customfield_10001.id}}\"\n }\n}","sendNotifications":false},"children":[],"conditions":[]}],"canOtherRuleTrigger":false,"notifyOnError":"FIRSTERROR","projects":[],"labels":[20360],"tags":[]}],"cloud":true}

NOTE

Copy the above JSON code in a file and save it as .json. Import it in JIRA to import the above rule.

Please note that it is not feasible to copy the value of any other custom field example "Select" field type to the Team field, as per the current structure of both field types. The exchange of values can only be possible with the "Teams" field with ID. As the select field holds ID in numeric, In contrast, the Teams field has a hexadecimal value as ID.

The ID of the value "TeamA" on the Select field is numeric: Custom field Select Type

1 "customfield_10054": {"self": "https://Myinstance.atlassian.net/rest/api/3/customFieldOption/10052", "value": "TEAMA", "id": "10052"}

In contrast, the Teams field has a hexadecimal value as ID : Team field Type

1 "customfield_10001": {"id": "b68cd80c-8ef2-4fe0-8g7a-40cd52b47b8d", "name": "TEAMA", "avatarUrl": "", "isVisible": true, "title": "API", "isShared": true}

You can manually parse the value of the Team field via automation by passing an ID like this :

1 2 3 4 5 { "fields": { "customfield_10001" : "b68cd80c-8ef2-4fe0-8g7a-40cd52b47b8d" } }

Updated on May 31, 2024

Still need help?

The Atlassian Community is here for you.