Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Automation: Error when creating a version

Iain Short May 14, 2021 edited

We have a JIRA automation, as an incoming webhook, that does the following:

  1. Create version called {{webhookData.releaseVersion}}
  2. For each issue in the payload assign the version

When we run this, more often than not, we see the following error in the audit log:

Create version

Failed to create version .
A version with this name already exists in this project. (name)
Successfully created version .
21.7
Version already exists. Continuing the rule with this version.
21.7

Edit issue

Issues edited successfully
JDX-423, JDX-425, JDX-420, JDX-436, JDX-393, JDX-417

 There is only one execution of the rule and we end up with two versions in JIRA... one that has no issues assigned and one that has all of them assigned.

Here's some screenshots:

Automation Rule:

Screenshot 2021-05-17 at 13.59.52.png

Audit Log:

Screenshot 2021-05-17 at 13.58.50.png

Any ideas what might be causing this?

3 answers

1 accepted

0 votes
Answer accepted
wwalser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 18, 2021 edited

"Gather issues from request" is an implicit "branch" (a loop). It executes the rest of the actions once per issue found in the received data.

That means if the webhook data contains 5 issues, automation will attempt creating the version 5 times. It'll only succeed only once (as it appears conflicting version names are not allowed) and it will assign all of the issues to that version.

Other than the error, it sounds like your automation is executing as expected.Iis that accurate?

Iain Short May 19, 2021 edited

Yes, that's right. Although we get 2 versions created regardless of how many issues are in the request.

wwalser
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2021

I presume if there is a single issue in the webhook, the create is only attempted once.

Two and beyond only print the success message once and the error message once? If that's the case then it must be true that we're deduping error/warning messages in the audit log to keep noise down. I've not noticed it in the past but that fact wouldn't shock me.

2 votes
Djairho Geuens
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 29, 2021

@wwalser I expect an automation that needs to create a new version to be triggered multiple times with the same version name. Everything works but the automation keeps showing that there were errors and sends out an email for this. Is it possible somehow to first check if the version already exists and if so, don't try to create it anymore?

The other alternative is not sending emails if an error occurs but I that's not my preferred solution obviously.

0 votes
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.
May 14, 2021

Hi @Iain Short 

Would you please post an image of your complete rule and one of the audit log for an execution where the symptom occurred?  That may provide context for the community to offer ideas.  Thanks!

Best regards,

Bill

Iain Short May 17, 2021

Sure. I've updated the issue to include screenshots. Thanks.

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.
May 19, 2021

Thanks for posting your rule, @Iain Short 

I agree with @wwalser about the built-in branch processing for that webhook trigger.  If the error is misleading/confusing your team, you could instead:

  • use the generic webhook trigger (no issues),
  • create the version,
  • parse out the issue key list out of the data with string and list functions, and
  • use a branch on JQL for the issue key list to update the items' version.

That should result in only one attempted call to create version.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events