Create Fix versions automatically incrementally.

Sujitha_Krishnan
Contributor
December 9, 2024

Hi Team,

I am trying to create an automation rule to auto create "fix version" in Jira in an incremental manner.

Example, if the latest fix version that was created in the project was Release25, then the rule when triggered creates Release26.

Its failing with error, any help in troubleshooting the problem is greatly appreciated. Thankyou.

 

Here is what I tried doing: 

1. The rule is scheduled to run every 4 weeks and as a first step, I am trying to fetch the latest release in the project.

Step 1.png

While I tried logging the response, it's blank. So I assume here is where the problem is. But I tried the same in postman and it does return a response and its what is expected.

Postman1.pngPostman2.png

2. Create Variable : LatestVersionName

Step 2.png

3. Create Variable : nextVersionName

Step 3.png

4. Creation of nextversion

Step 4.png

 

Response of the rule:

Rule Response.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.
December 9, 2024

Hi @Sujitha_Krishnan 

First thing, the audit log image you show does not match the rule images shown.  That is apparent as the log shows a write to the log with "API Response: " but that is not present in the rule images.

Please post your entire current rule, in a single image, and of the current audit log details showing that rule execution.  Posting the rule in one image will help provide context, and may be done using a screen capture tool or browser addon which support scrolling page capture.

 

Next, when you get the existing versions with the Send Web Request action, the result should already be in JSON.  Why are you adding the function asJson when extracting the version name?

I recommend writing the entire web response smart value to the log to confirm it contains what you expect before trying to parse it.

 

Finally, once that is done, you may find this is why the created variable is empty, leading the later rule error.

 

Kind regards,
Bill

Sujitha_Krishnan
Contributor
December 9, 2024

Thanks for the response Bill.

Here is a screenshot of the rule in one image:

Rule in One page.png

the current audit log details showing that rule execution

Audit Logs.png

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.
December 9, 2024

Thank you for that information, and...

The smart value to see the entire webhook response message would be:

{{webhookResponse.body}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--webhookResponse--

 

And for that REST API endpoint to get the list of versions, I believe you want this smart value expression:

{{webhookResponse.body.last.name}}

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-project-projectidorkey-versions-get

 

Although given the possible number of versions could eventually be more than the 100 limit, you may want to use this one instead as it supports query and status parameters for filtering results: 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-project-projectidorkey-version-get

 

Sujitha_Krishnan
Contributor
December 9, 2024

Thanks Bill. Let me update the rule as per your comment and try again.

Sujitha_Krishnan
Contributor
December 9, 2024

Thanks Bill, much appreciated! It worked.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events