This article explains how to combine the JQL Precondition and Update Any Issue Field (JSU) post function to set a field value if the assignee of a ticket belongs to a particular group.
Use cases:
How to check group membership of assignee using JQL pre-condition(JSU).
How to set a field value using Update Any Issue Field (JSU) post function
This is the documentation of JSU for Jira Cloud. If you are using JSU on Jira Server or on Jira Data Center, see our JSU Server/Data Center documentation to implement this use case.
Instructions
Example use case: Here, we are updating a single select list field to “Yes” if the assignee of the ticket belongs to the “dev-team” group.
Log in to Jira as an Admin and go to the workflow that is associated with your project and issue type.
In the workflow, click Edit to switch to Edit mode.
Select the desired transition, select the Post Functions tab and click Add post function.
Select Update Any Issue Field (JSU) and click Add.
Click on Add Precondition and add JQL Precondition.
Configure the precondition as below:
JQL:
key = {issue.key} and assignee in membersOf("dev-team")
Replace
dev-team
with the desired group name.Set the parameters of the post function as follows:
Select the “Preconditions must be” as True.
Select “Update field on all issues related as” as Within same Issue
Issue Field: select the target field here.
Choose the desired user in “Perform As User:”. Make sure this user has edit issues permissions on the issue.
Field Value: Add the desired value here.
Click Add.
Publish the workflow.
JSU Post-function reference:
It is recommended to test this scenario in a non-production environment before implementing it in a production environment.