It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create on transition if parent matches JQL?

I've been using the COT plugin for a while and finding it really helpful. I have a new requirement that I'm a bit stumped on, though, and I'm wondering if the conditions are just too much for this plugin. And if so, what other options do I have?

We have a custom multi-line text field called Code Objects that are used with one specific component. I need to create a subtask on transition if there's a partial or complete match in that field for a specified list (array?) of strings. Basically, if the issue being transitioned would be found by the following JQL, a subtask needs to be created.

project = PH AND cf[10204] is not EMPTY AND (cf[10204] ~ WEB OR cf[10204] ~ SUS OR cf[10204] ~ POSSEND OR cf[10204] ~ PINOTIF OR cf[10204] ~ PIMAIL OR cf[10204] ~ WRCCTOKEN OR cf[10204] ~ VSATTEST OR cf[10204] ~ WREXTCODE OR cf[10204] ~ WRMASTER OR cf[10204] ~ WRPEDIT OR cf[10204] ~ WRLDSTR OR cf[10204] ~ WRTOPPRULE OR cf[10204] ~ OUTOFPROD)


Is this possible? It seems a bit much for a regex.

1 answer

Hi @Esther Strom

The JQL query should work. However, you just need to replace the custom field id with the custom field name in the JQL of the Create on Transition post function. Ensure to use % at the start and end of the custom field name. 

project = PH AND %customfieldname% is not EMPTY AND (%customfieldname% ~ WEB OR %customfieldname% ~ SUS OR %customfieldname% ~ POSSEND OR %customfieldname% ~ PINOTIF OR %customfieldname% ~ PIMAIL OR %customfieldname% ~ WRCCTOKEN OR %customfieldname% ~ VSATTEST OR %customfieldname% ~ WREXTCODE OR %customfieldname% ~ WRMASTER OR %customfieldname% ~ WRPEDIT OR %customfieldname% ~ WRLDSTR OR %customfieldname% ~ WRTOPPRULE OR %customfieldname% ~ OUTOFPROD)

Alternatively, you can also use the | symbol for the values as shown below

Conditions:
Condition value: %original_customfieldname%, Regex pattern: value1|value2|value3|value4|value5

 

Thanks,
Amith Mathur

It's good to know that it SHOULD work; I just can't seem to make it happen. In the interest of simplifying during testing, I tried setting up only one string to search for. 

Here's my setup (note that the Create Subtask postfunction is actually the final step, after the Generic Event; I just took the screenshot before moving it):

 

postFunction.png

And here's a search to show that there is at least one ticket that should match the regex I set up. In that ticket, the value in the multi-line custom field is "WRPEDIT.int", which according to RegExr does match the expression I'm using in the regex.

search.png

So where am I going wrong? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Join our Webinar: 5 use cases to supercharge Jira with apps

G’day Atlassian Community! We’re excited to announce that we’ll be doing a new webinar on 5 use cases to supercharge Jira Cloud. The Atlassian Marketplace offers customers thousands of apps and int...

90 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you