Forums

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

validator to check if other subtasks of the same parent where assigned to the current user

Marco Brundel
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 Leaders.
February 1, 2024

Hi,

A customer of my registered a Story with multiple sub-tasks.
Now they want to use a validator to enforce that running a review task is not done by the same user/assignee who ran the test report or development task.

On Jira Server a JMWE validator was used to check if other subtasks of the same parent where assigned to the current user, but on Jira Cloud "Issues returned by the following Groovy script" is not supported.

Does anyone have a solution/alternative on how to accomplish this on Jira Cloud?
Scriptrunner, JMWE and JSU are installed.

regards, Marco

 Screenshot 2024-02-01 at 10.43.57.png

2 answers

1 accepted

0 votes
Answer accepted
Suprija Sirikonda _Appfire_
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 Leaders.
February 1, 2024

Hi @Marco Brundel,

You can add the below Jira Expression in JMWE Build-your-own (scripted) Validator that returns true if all the sub-tasks of the current sub-task's parent, whose summary is "Ontwikkelen", are not assigned to the current user: 

!issue.parent || issue.parent.subtasks.every(it => ((it.summary != "Ontwikkelen") || !it.assignee || (it.assignee.accountId != user.accountId)))

 I hope this helps!

BTW, I'm from Appfire, the vendor of JMWE app. We have opened a support ticket SUPPORT-166845 in our support portal to better track your request and we added you as a reporter. If you need us to make any changes to the reporter field or unable to access the ticket, please let us know here in this thread.

Regards,

Suprija | Appfire

0 votes
Kristian Walker _Adaptavist_
Community Champion
February 1, 2024

Hi Marco,

I can confirm inside of ScriptRunner for Jira Cloud you can write a workflow validator to achieve your use case.

Workflow Validators use the JIra Expression Framework in Jira cloud provided by Atlassian, and we have some example expressions located here to show how these work.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer