Automation to create issue if no existing issue has a matching summary

Rod Dennis November 6, 2020

I would like to create an automation that creates a Jira issue when a GitLab issue is filed. I cannot use the GitLab integrations.

I am using the incoming webhook (with JQL) approach to see if the issue title returned by GitLab matches the summary of any issue in Jira. If there is not a match I would like the automation to create a single issue. 

Currently, my automation is creating an issue for every issue whose title doesn't match an existing summary, resulting in mass issue creation. I'd like to have this automation create a single issue when no match is found. 

Screen Shot 2020-11-06 at 14.53.11.png

1 answer

1 accepted

3 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2020

Hi @Rod Dennis 

I am wondering about the trigger you are using and the incoming webhook information...

Is your rule triggered on the incoming webhook?  If so, perhaps the test you are using to check for existence (as part of the epic) would always return empty and so fail because there is no issue within the context yet.

If you are triggered by the incoming webhook, please consider instead using lookupIssues to count the matching issues, and proceed if none are found:

  • Trigger: incoming webhook
  • Action: lookupIssues with JQL to match, such as
    • project = myProject AND summary ~ {{webhookData.object_attributes.title}}
  • Condition: If {{lookupIssues.size|0}} equals zero (0)
    • Action: proceed to create your issue

As a suggestion, consider just adding a statement in the rule log until you are certain this works, and then add the Create Issue action.

Best regards,

Bill

Bembol Roco May 4, 2021

I hope you still see this. I am looking to get the same scenario, if JQL returned no issues it will create new issue. However i somehow can't find the right condition for that.

In your condition, what should i use?

nvm. got it

jira.PNG

Graham Beckley March 16, 2023

How did you end up solving this issue, @Bembol Roco ?

Like aklein likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events