How to conditional execution subtask JMWE

NewByatl
Contributor
August 4, 2023

I'm trying to check something like this

 

IF (subtask doesnt contains summary "QA"){

return true

}

 

how to validate it? (I need to do it via JMWE extension)

 

My code looks like this, but it doesn't works (it returns me true every time):Снимок экрана 2023-08-04 в 17.39.33.png

 

!issue.get("subtasks")?.any{it.getIssueType().getName() && it.get("summary").contains("QA") }

3 answers

1 accepted

0 votes
Answer accepted
Dante Balanda (Appfire) August 4, 2023
Hello,

For the use case  "If subtask doesnt contains summary "QA" return true" you can use the following:


 !issue.subTaskObjects.any{it.get("summary").contains("QA")}


This will look for all of the subtasks of the issue and check if any of them contain “QA” in their summary. If none of them have it, it will return true. Please mind that this will look for the word QA in any part of the summary of all subtasks.

If you are still missing something for your use case, let us know.

Regards
NewByatl
Contributor
August 5, 2023

It works! Thank u)

0 votes
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.
August 4, 2023

Hi @NewByatl 

Can you please explain what you're trying to achieve, and in which post function you're trying to use this conditional execution script?

The script you have written checks all subtasks of the issue being transitioned, is that really what you need? I would think you're actually trying to do something on a particular subtask of the issue, no?

NewByatl
Contributor
August 5, 2023

I'm trying to check just one subtask with summary "QA" yea

0 votes
Sandeep Saluru {Appfire} August 4, 2023

Hi @NewByatl 

We are from the Appfire support team and would like to inform you that we have created a support request https://appfire.atlassian.net/servicedesk/customer/portal/11/SUPPORT-98594  on your behalf in our portal.

Request you to signup into the portal and let us know the username so that we can mark you as the reporter to be able to access the ticket. Please find the link https://appfire.atlassian.net/servicedesk/customer/portal/11 to signup for the portal.

 

Regards,

Sandeep

Suggest an answer

Log in or Sign up to answer