Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to write condition of checking linked issue's summary for Create / Clone Issue(s) Post-function

Hi everyone, 

As title, recently I faced a problem which is needing to write a condition of checking linked issue's summary on " Create / Clone Issue(s) ". This is because I want the workflow is checking whether there is already a linked issue  with same summary before creating linked issue. However, I stuck on writing this checking linked issue's summary condition. Could someone can help me on this? Thank you very much!

 

 

2 answers

1 accepted

2 votes
Answer accepted

Hi @Kris Han ,

you can use this Groovy script in the conditional execution section of the Create / Clone Issue(s) post-function:

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

Hi  @David Fischer _Appfire_ ,

Thanks for your answer. However, this answer will only for checking all linked issues, but not issues in an Epic. I am actually  looking for the condition which will check "issues in Epic" linked issues' summary. For "issue.stories", this will only return linked issues' ID not summary. Do you have any idea? Thank you very much!

Like John Funk likes this

Hi @David Fischer _Appfire_ ,

I think I found the answer what I need, really thanks for your help. Below is the answer for my question:

issue.stories.any{ it.summary == "summary" }

 

Thanks for everyone!

Like John Funk likes this
0 votes

There are a couple of steps in this.

First, you need to look for the summary in the linked issues - https://library.adaptavist.com/entity/copy-field-value-from-linked-issue is about copying values, but could easily be modified just to check.

Second, you'd need to do the blocking.  This is going to be a problem for you though.  A post-function is too late.  To have a post-function check a value and stop you going further, you actually have to force a complete crash of the process, which can corrupt your data.

Instead, you should be doing this in a validator - these gracefully halt a transition.  They return either "true - validation passed" or "false, validation failed, and here's an optional error message to give back to the user"  

Hi @Nic Brough _Adaptavist_ ,

Thanks for answering my question. However, I have tried that link you posted for modifying to check linked issue summary but I fail. Could you help me to provide the script which can check linked issue's summary? Thank you very much! 

Suggest an answer

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

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

349 views 5 10
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