The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Check if the value of a custom field = yes and if the user is an a local group

Robb F Watkins
March 12, 2021

I am trying to check if the custom field value = yes  (It is a Radio Button) and if the user is in a specific group - using ScriptRunner - Jira Cloud - This is a Condition

Is this the best way to do that?  Or is there a better way?

(
(issue["customfield_123"] || {}).value == "Yes" &&
user.groups.includes("Any_Local_Group_Name")
) ||

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Kate Kabir
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 16, 2021

Hi @Robb F Watkins 

Thank you for your question.

I can confirm that the ScriptRunner for Jira Cloud plugin provides workflow Validators using the Jira Expression Framework as documented in the Atlassian API documentation page located here or in the documentation page located here which explains how to add in a new validator to your workflow.

We can confirm that when viewing the Jira Expression Framework API documentation page linked above you can navigate to the Context variables section which shows what variables are provided by this framework that can be used to create the expression.

If you then click on one of the variables it will show all the properties that can be called on the variable for the expression such as for the issue variable as shown here and you will be able to check this to see if Atlassian provides a variable that contains the item you want to check against.

We can also confirm we have some examples of validators that can be used as a reference guide in the page located here as well as in the documentation page located here.

We would recommend using these documentation pages linked above as a reference guide to help to create the validator expression that you require.

I hope this information helps.

Kind regards,
Kate

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events