Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Determine in an automation if a story was already created

I'm not fiding a solution for this hope someone can help me, I have an automation with github for PRs, the automation is based on when a specific label is added to a PR on github a story is created on jira, my problem is that after if someone adds more labels the story is being created again and again. 

I tried to use a JQL condition like summary !~ 'Review PR {{webhookData.pull_request.number}}' to check if the story was already created but it does not work.

Any help here on how I can check if the story for the PR was already created? 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Tiago Pinheiro -- Welcome to the Atlassian Community!

When you note "it does not work" what do you observe happening?

Next, if you test that JQL manually with an known PR number, does it work as you expect?

Finally, I would expect that JQL to return a lot of issues using NOT CONTAINS (!~) so perhaps:

  • instead try matching on the PR number with the JQL,
    • summary ~ "Review PR {{webhookData.pull_request.number}}"
  • storing the results in a Lookup Issues action, and
  • then only proceed when {{lookupIssues.size|0}} equals 0 (using an advanced compare condition.

Kind regards,

Not sure if I added it the right way, but added a Branch rule with JQL with the query above + the Advanced compare condition with  {{lookupIssues.size|0}} equals 0 but it's not working 

Did you first test the JQL with an example PR Number in advanced issue search?  That will confirm the JQL is working before you try anything else.

And, rather than using a branch, instead use the JQL with the Lookup Issues action.  Then you can test the result in the condition.

Thanks, it works, didn't notice that there was a Lookup Issues action

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,426 views 37 44
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