If you’re using Jira Service Management, you may find yourself searching for a quick way to find all users who belong to a specific group and apply automations in Jira. You always have an option to add users one by one right to the request for assignment, approvals, or simply as participants, but it may be too time-consuming. There is also a chance that the person you need is off work, and with group automation you have other people being able to pick up the request. Let’s have a look at a couple of usage scenarios and workarounds we’ve elaborated.
Though Jira was updated recently, with the feature to use Approval groups added, it still does not cover all user needs. So we came up with the following automation rule to help you use groups in automations faster and easier.
Imagine, you need to approve a security change with the Security group before it comes to CAB approval, or you want to receive approval from the Security group for the user requesting antivirus software. To be sure everything goes smoothly, you want to implement a smart approval process in Jira Service Management, and populate all members of a specific group (for example Security group) as approvers.
https://<your_domain>.atlassian.net/rest/api/3/group/member?groupname=<group_ name>
You can find more details on web request authorization here, if you are interested.
2. Put a response in a variable which can be later used within the automation rule:
3. Now put the groupMembers variable into the Approvers field and:
Your Jira Service Management requests are assigned to specific groups based on the nature of the request. There are no group assignments out of the box, so we usually use the Assignment group approach. And as soon as the request is assigned to a specific group you want to make sure that the assignee (which is a single-user field in Jira — the user who is responsible for the request) belongs to the Assignment group”\ set in the request.
https://<your_domain>.atlassian.net/rest/api/3/group/member?groupname={{issue.Assignment group}}
2. And then put a response in a variable:
members = {{webResponse.body.values.accountId.join("|")}}
As a result, you have a string variable filled with assignee IDs separated with "|"
Having that set, you now can easily check if {{members}} contains {{assigneeId}}
As you’ve set all automation rules, you can now add an action. If your assignee is in the group, then do nothing, but if not, clear the assignee field and leave a comment, or notify someone for extra moderation of the request.
And that’s it.
Just curious - have you ever faced a challenge like this? If yes, what did you do? Please, share your stories in the comments, and let’s discuss.
Alex Kiselev _Itransition_
Atlassian Expert
Itransition Group Limited
Poland
3 accepted answers
6 comments