Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Creating issue in post function depending on summary of linked issue

Hi all,

my request is the following:

I want to create a new issue within a post funtion and set a condition depending on the already existing linked issues to the current issue. Means, the transition should check, if a linked issue with a certain summary already existis and if yes, then the issue should not be created within the post function. If it doens't exist, the issue should be created. 

We are using JMWE Plugin for creating issues within a post function.

Hope, someone can help me.

BR
Franzi

2 answers

1 accepted

0 votes
Answer accepted

Hi @Franzi Jos 

you can use something like this as the Conditional Execution script:

!issue.getLinkedIssues().any{it.summary == "A summary"}

Hello,

thank you but it seem like this doesn't work properly as it always returns "true" even if I enter something senseless

2021-12-03 10_30_10-Update Workflow Transition Create _ Clone issue(s) (JMWE app) Function - Brodos .png

BR
Franzi

@Franzi Jos ,

that's kind of normal: you want the post function to run unless there is a linked issue that has the specified Summary, so unless the issue has a linked issue with "tgtihertzh" as its summary, the code will return true.

Don't forget that the post function will run unless the Conditional Execution script returns false (true means continue running, false means "skip")

Oooh ok, so I need the complete name of the summary, not only a part of like "summary contains"... But in this case, this is hard because the summary differs from issue to issue depending on a certain custom field content. Can I also enter the custom field variable in this script like 

!issue.getLinkedIssues().any{it.summary == "SEO package - "custom field xxx""}

Or is there a wy to write the script in a way that doesn't ask for the specific whole summary but only a part if it? 

If you want to test for a substring of the summary, you can use this:

!issue.getLinkedIssues().any{it.summary.contains("A partial summary")}

And if you want to test against a summary built from other values:

!issue.getLinkedIssues().any{it.summary == "SEO package - ${it.getAsString("customfield_12345")}"}
Like Franzi Jos likes this

thanks, this works perfectly now :)

Hello,

I advise you to contact JMWE support, they will always get back to you with a solution.

 

https://innovalog.atlassian.net/servicedesk/customer/portals

Suggest an answer

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

How we use Jira Service Management for our recruitment process! - Part 2

It is never about setting up a process and being done with it. Rather, the focus should always be on optimizing it for the best outcomes. Thus, we didn’t stop at setting up JSM for our recruitment pr...

182 views 0 5
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