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: 

Scriptrunner validator transition require checkbox

Daren Seto
March 22, 2024

I am attempting to add a validator to a workflow.

I have tried a couple different scripts but wasnt sure if how to complete.
Would something as simple as this code work? 

Or do i need something more complex.

I have two fields

Code review assignee - customfield_13300
Code review complete - customfield_14130

If code review assignee has a value i want to require code review complete to equal yes 

I tried this code but i am unfamiliar with scriptrunner

and( issue.fields['customfield_13300'].hasvalue, issue.fields['customfield_14130'].value == "yes" )

Screenshot 2024-03-22 at 11.09.41 AM.pngScreenshot 2024-03-22 at 11.09.35 AM.png

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Kristian Walker _Adaptavist_
Community Champion
March 28, 2024

Hi Daren,

Thank you for your question.

I can confirm that in ScriptRunner for Jira Cloud that Workflow validators use the Jira Expression framework provided by Atlassian, and you will need to use these to create the conditions you require.

It sounds from your description that you require that when a value is selected in a user picker field named Code review assignee, the checkbox field named  Code review complete must have the value yes.

I can confirm we have an example here which shows how to check if a user picker field has a certain value and in the example here, we show how to check if a checkbox field has a certain value selected.

Using these examples and the linked Jira Expression documentation should help as a guide to help you create the expression required to solve your requirement.

I hope this information helps.

Regards,

Kristian

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events