Forums

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

PUT /version/id returns 500 from Jira Automation, but works with curl

Anders Rosén June 5, 2025

I'm trying to set up an automation that should add a description to a given version when that version is released. Since there's no automation task for updating version descriptions, I'm using the Send web request task to do this through the API.

Web request URL: https://<my-domain>.atlassian.net/rest/api/3/version/{{version.id}}
HTTP method: PUT
Web request body: Custom data
Custom data:
{
    "description": "Version {{version.name}} was released on {{now}}."
}
Headers:
Content-Type: application/json
Authorization: Basic <my-email:my-token | base64>

 

Problem

Jira Automation

Simple as that. However, when I'm triggering the automation it fails. The Audit log reports "Some errors".

Show more shows this:


Version released 06/05/2025, 11:20:51
Send web request 06/05/2025, 11:20:51
Unable to publish the web request - received HTTP status response:
500
Error found in the HTTP body response:
{"status-code":500,"stack-trace":""}

Not much information, just a status code 500.

Curl

Shooting directly at the endpoint using Postman doesn't work either, but with curl it works just fine!

curl command:


curl -u <my-email>:<my-token> -X PUT "https://<my-domain>.atlassian.net/rest/api/3/version/11538" -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"description\": \"This is a pretty nice description\"}"


Where 11538 is an ID of one of the versions.

 

Things I've tried

I do have the ADMINISTER_PROJECTS permission, checked that through the mypermissions endpoint.

I have also tried:

  • Other combinations of JSON data in the body
  • Changing the actor of the automation from "Automation for Jira" to myself
  • Create a new API token with ALL the access rights (not only the ones specified in the AIPI documentation: write:project-version:jira, read:project-version:jira)
  • Doing a POST to /version/{{version.id}}/move, same error there

 

Conclusion

I was thinking that maybe it's an issue with the headers sent but an internal server error doesn't indicate that(?).

Anyone has any idea what could be wrong? 

1 answer

0 votes
Marc - Devoteam
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.
June 5, 2025

Hi @Anders Rosén 

Welcome to the community.

This works fine in postman

payload example:

Custom data:
{
      "description": "Version was released on {{now}}."
}

Result is "Version was released on {{now}}.", this as description is a text field.

Marc - Devoteam
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.
June 5, 2025

Can you show:

1. what type of project is this (e.g., company-managed, team-managed, etc.), 

2. images that show your complete rule.

3. images showing the details of any relevant actions/conditions/branches.

4. images showing the Audit Log details for the rule execution.

5. Explain where the issue is.

These questions are not for not willing to help, but to have community members understand on how automation works.

Like Anders Rosén likes this
Anders Rosén June 5, 2025

Hi @Marc - Devoteam , thank you for your reply!

In the API docs for Rest API v3, it's clear that the id is required as a query parameter and since it's present in the end of the URL, that should be correct: https://<my-domain>.atlassian.net/rest/api/3/version/{{version.id}}
I can't see anything about it being required in the request body.

I tried it anyway but it didn't help, I'm still getting the same error back.

Do you have any other tricks or want me to provide more info about anything in particular?

Anders Rosén June 5, 2025

1. It's company managed

2. Complete rule

image.png

3. N/A

4. Audit logs
image.png

5. The issue is probably not in the automation itself since it doesn't work in Postman either, it's probably in the Rest API.

 

Marc - Devoteam
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.
June 6, 2025

Hi @Anders Rosén 

In your automation, create a variable.

Call this variable version and set the smart value to {{version.id}}

In de web request custom date set the id to: "id": "{{version.id}}

Anders Rosén June 9, 2025

@Marc - Devoteam I suppose you meant to set the id to {{version}} and not {{version.id}}? I tried both but I got the same error unfortunately.

image.png

image.png

image.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.
June 9, 2025

Hi @Anders Rosén -- Welcome to the Atlassian Community!

Adding to the suggestions from @Marc - Devoteam 

First, I recommend not naming variables in a manner which matches any other smart values.  Doing so will confuse people reading the rule and the rule processing.  For example, I always add a prefix to prevent collision, such as with varVersionId.

Next, when calling that endpoint, the ID is in the URL so do not include it in the custom data sent.  Instead only send the description in the custom data for your scenario.

Kind regards,
Bill

Like Anders Rosén likes this
Anders Rosén June 10, 2025

Hi @Bill Sheboy and thank you for your input!

Good tip about the naming of variables.

As you can see in my original ticket, I didn't have the ID in the custom data to begin with.

If you have any other suggestions, please react out.

 

/ Anders

Like Bill Sheboy likes this
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.
June 10, 2025

This rule you show does have the ID in the data:

https://community.atlassian.com/forums/Jira-questions/Re-Re-PUT-version-id-returns-500-from-Jira-Automation/qaq-p/3040368/comment-id/1129754#M1129754

 

Another possible problem is racetrack errors / timing.

The Send Web Request action (URL and data), can try to validate before fully evaluating the smart values involved.  The way to check for that cause is to use Create Variable to first store the custom data, perhaps named varCustomData.  Then use just {{varCustomData}} in the action.  This will force the expression to fully evaluate before use in the rule action.

 

One more thing to check: version name contents.

What is in your version name?  If it contains special characters, you may need to add jsonEncode to it in the data.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding

Like Anders Rosén likes this
Anders Rosén June 11, 2025

Yes that was added after a suggestion by Marc, though I see now that his reply has been edited. My original request looked like this:


Web request URL: https://<my-domain>.atlassian.net/rest/api/3/version/{{version.id}}
HTTP method: PUT
Web request body: Custom data
Custom data:
{
    "description": "Version {{version.name}} was released on {{now}}."
}
Headers:
Content-Type: application/json
Authorization: Basic <my-email:my-token | base64>


 

Racetrack errors / timing

Good idea, it could be that the payload is incorrect since i used the variable {{version.name}} in the description. I removed that entirely and set version.id as a custom variable named varCustomData but the result was the same, Internal server error with no more information.

image.pngimage.pngimage.pngimage.png

 

Version name contents

As for now, I have named my versions TestAutomationVersion1, TestAutomationVersion2, etc. I have also tried to release versions with a space in the name, like Application 1, Application 2. 

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.
June 11, 2025

Let's fault isolate this a bit:

  • With your current rule...
  • Copy the Send Web Request action so you now have two.  This is just a temporary change for a test.
  • Update the URL to a specific version ID value; that is, no smart value
  • Update the custom data to a specific description value; again, no smart value
  • At the bottom of that action, look for Validate your web request configuration
    • Open that expanding area, and select Validate to run the request
    • Review the results
  • When done, delete the copied action from the rule

 

This helps confirm everything is well-formed in the request, including the URL, data, and headers.  And it may reveal what the problem is to update the original call.

 

Suggest an answer

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

Atlassian Community Events