Update the Approver groups field with Automation in JSM Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
By default, your IT service management (ITSM) service project comes with an Approvers field for adding individual approvers, and an Approver groups field for adding groups of approvers. Also If desired, you can also create your own custom fields for approvals.
In this article we'll focus on how to update Approver groups field using an Automation rule.
Solution
Get group ID to use in Automation rule
Visit admin.atlassian.com
Depending on your user management experience, navigate to the Groups page
Select the required Group
Copy the groupId from the URL, which comes after
/groups/
For example: https://admin.atlassian.com/o/<org_id>/groups/<group_id>
This ID will be used in the next step, which is building the automation rule.
Update the Approver groups field through Automation
In the Service Project, go to Project Settings → Automation
Select Create rule
Set the trigger as Work item created
Add an Edit work item action
Select More actions > Additional fields
Add the following JSON to the Additional fields section
Replace the Group name and Group ID based on the previous step
{ "update": { "Approver groups": [ { "add": { "name": "[REPLACE WITH NAME OF THE APPROVER GROUP]", "groupId": "[REPLACE WITH groupId]", "self": "https://[REPLACE WITH SITE NAME].atlassian.net/rest/api/3/group?groupId=[REPLACE WITH groupId]" } } ] } }
For example, imagine you have a site called mysite.atlassian.com and a group named "Example group" with ID 23789204-e4aa-4a60-965c-59c651914932.
In that case, the JSON will look like the following:
{
"update": {
"Approver groups": [
{
"add": {
"name": "Example group",
"groupId": "23789204-e4aa-4a60-965c-59c651914932",
"self": "https://mysite.atlassian.net/rest/api/3/group?groupId=23789204-e4aa-4a60-965c-59c651914932"
}
}
]
}
}
Note: if you have created your own custom fields for approvals related to Groups you would simply need to replace the "Approver groups" field in the payload above to your own custom field information (e.g. customfield_13241).
To get the custom field ID, please refer to our article on the topic.
Was this helpful?