This article is for Data Center.
When we want to assign a Jira issue to a specific Tempo Team based on assignee. Unlike Tempo Account, Tempo Team is not a recognized field by Automation for Jira , we will show how to setup the rule to update Team value in Jira issue below.
-
You can get a list of Tempo Teams with:
http://localhost:8080/rest/tempo-teams/2/teamand the results should look like this:
[ { "id": 3, "name": "Accounting", "mission": "", "summary": "Accounting and Billing group", "lead": "JIRAUSER10703", "isPublic": false }, { "id": 4, "name": "BJT", "summary": "", "lead": "swu", "program": "Tempo Support", "isPublic": false }, { "id": 17, "name": "Company Plans", "summary": "", "lead": "swu", "isPublic": false }, { "id": 1, "name": "Default Tempo Team", "mission": "", "summary": "", "lead": "swu", "program": "Tempo Support", "isPublic": false }, ... ]You will need to know which Team ID you want to assign for the assignee or user group.
-
Also, you need to find out what is Jira custom field number (customfield_#####) for Tempo Team in Jira System > Manage apps > Tempo > Custom Fields > (Tempo) Team (id: #####).
Tempo Team ID -
Create a new rule in Jira System > Automation For Jira > Automation rules. You can create a rule of global or project scope, depending your requirement.
Rule details -
Select a trigger on Issue assigned and Save
Issue assigned -
Add component with New condition on If / else block
If/else block -
For If block, add conditions with Advanced compare condition
Advanced compare condition -
First value = {{issue.assignee.key}}, Condition = equals, Second value = userkey, and Save the block. This is using Jira smart value . This IF condition is to update a specific Team for a specific user.
If block -
Add Component inside/under If block with New action of Send web request, instead of Edit issue, because Tempo Team is not recognized by Automation.
Send web request -
Webhook URL should be Jira REST API issue search of current issue with {{issue.key}}
Update Team custom field -
As headers, please add
Content-type application/json
Authorization Basic xxxxxx
(The Authorization is basic. To find the authentication in the correct format, you can use the terminal with a command like:
echo -n username:password | base64
or run the REST API in Postman and it will show the value for the authentication) -
Update Tempo Team value with desired Team ID in the issue by using PUT with Custom data:
{ "fields":{ "customfield_10201": "4" } }and click Save.
-
You can validate the webhook if the request works with issue key.
-
For Else-if block, add condition with User condition: User = Assignee, Check to perform = is in group, Criteria = Jira user group(s). This Else condition is to update a specific Team for specific Jira user group(s).
Else block -
Add component inside/under Else block with the same web request as above (IF block), but with a different Team ID.
-
Save and publish the automation.
It’s best to test out your rule within a Project first and then change to global after the rule has run successfully.