JMWE validation

Issa May 14, 2024

Hi,

 

We have requirement to validate the subtasks. if subtasks are closed or excluded then transition of parent issue should be possible. We're using JMWE validator "Related issues status validator".

But the challenge is these subtasks have a select list custom field "customfield_1". having options 1.Automated 2. Manual.

We want the validator in such a way that only subtasks having closed or excluded status with "customfield_1" = "Automated" to be checked. Other subtasks with "customfield_1"= manual can be skipped even if these subtasks are not closed or excluded it should allow for the transition.

 

Any suggestion would be helpful!

 

2 answers

2 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 14, 2024

Hi @Issa 

for that requirement, you shouldn't use the Related Issues Status Validator but instead the Related Issues Validator. 

For the "Mode" option, select "Check related issues". Then select "Sub-tasks of the current issue". Finally, under "Condition on related issues", use the following script, and check the "All related issues must verify the condition above" option:

relatedIssue.getAsString("customfield_1") != "Automated" || relatedIssue.get("status").name in ["Closed","Excluded"]

You'll need to replace  customfield_1 with the name or ID of your custom field, and check the status names (which are case-sensitive).

Issa May 24, 2024

Thanks David.

 

It worked like charm :)

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2024

Hi @Issa 

I'm glad it worked.

However, I'm afraid you "accepted" the wrong answer... Can you please accept my answer instead, as it would otherwise mislead other readers?

0 votes
Answer accepted
Carla Ann Rowland
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 14, 2024

Using JMWE I would use a JQL that includes the sub-tasks as part of the criteria, try: Summary ~"Customfield_1"  AND  (issuetype = "sub-task" AND Statuscategory = Done)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.1
TAGS
AUG Leaders

Atlassian Community Events