Jira Automation to archive fix version

Brian Husk
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!
January 10, 2025

Hi, I am new to this forum and hoping someone can answer a question for me.

 

I am wanting to use Jira automation to automatically archive a fix version when it is set to released (version released trigger).  Based on some previous questions on this topic, it seems as though it might be possible to use the Send Web Request action with a PUT request.

Based on what I've found so far, it seems like in order to update the Fix Version with the REST API, I need to include the version ID in the web hook url field.  Is this right?  If so I'm not sure how I would pass the ID value to the Send Web Request action in order to send the right JSON data to change the value to archived.  Is there a way around this?

 

1 answer

1 vote
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.
January 10, 2025

Hi @Brian Husk -- Welcome to the Atlassian Community!

Yes, that sounds correct.

To get the version's ID, your rule could use the Version Released trigger and then make the call to the REST API endpoint using the Send Web Request action:

https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html#Jirasmartvaluesissues-version

Kind regards,
Bill

Brian Husk
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!
January 10, 2025

Thank you, Bill.

My question has to do with the Send web request action and the web hook URL field itself.

In order to update the value to Archived, the Web hook URL needs to have a version ID associated with it in the path.  Is that correct?  I.e. the url in the field should be jirahost.com/rest/api/2/version/version-id ? 

If the field is hard-coded, how would I pass the version id from the trigger to the send web request action?  The ID will dynamically change with each version, which means that url will need to change with each version, right?

I need some way to capture the version id based on the version that triggered the rule, and pass it to the web request action.  Not sure how to do that.  

 

 

 

 

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.
January 10, 2025

Please use the smart value to pass the ID.  Assuming the rule trigger is Version Released, and with this endpoint, that would be this:

jirahost.com/rest/api/2/version/{{version.id}}

If that does not work, please post images of:

  • your complete rule,
  • the Send Web Request action (hiding any site details), and
  • of the audit log details showing the rule execution.
Like Vikrant Yadav likes this

Suggest an answer

Log in or Sign up to answer