Changing Version Driver field with rest_api

Rees_ Ian February 8, 2024

I can successfully get the Version Driver field using a web request in my automation using a GET /rest/api/3/version/<version_id>?expand=driver.

I am trying to test if I can change that with a PUT but not sure what the body content should be. I have tried a PUT request to rest/api/3/version/{id}

with the following body { "driver": "accountid" }

to no avail - any ideas if I can change this and what body content would be. Thanks

2 answers

1 accepted

0 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.
February 8, 2024

Hi @Rees_ Ian 

I have not tried that, however the REST API doc describes adding expand to the request to add things like the driver:

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

Kind regards,
Bill

Rees_ Ian February 9, 2024

Hi Bill,

I'm using a PUT request /api/3/version/versionid?expand=driver

but the body is a bit of guesswork

{
"accountId": "account id"
}

Web Request is successful if I use an empty body {} but 400 error "":["Invalid request payload. Refer to the REST API documentation and try again."]}" when I use the body above.

The account id is an exact copy of what I see for the accountId in the response when I use GET to get the driver values

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

I have not tried that, and my searches of the documentation and developer community posts did not show examples: https://community.developer.atlassian.com/

Perhaps at least one other (not expanded) attribute must be supplied in the body.  Try with no expand and one attribute first to confirm the function is even working, then add the expand and driver.

If that does not work, your options could be: experiment further, post a question in the developer community, or ping the Atlassian Support team.

For that last one, as you are the site admin of a paid license you can do that here: https://support.atlassian.com/contact/#/

Like Rees_ Ian likes this
David Bakkers
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.
February 9, 2024

Hello @Rees_ Ian 

I don't think it's possible to set a version's driver via the REST API. As you've discovered, you can find the contents of the driver object (a Users account ID) via the expand parameter with a GET request, but that seems to be it.

The documentation is very strange in that it describes that you can use the expand parameter with the two PUT and POST requests, but it says that is only to "include additional information about version in the response", so that parameter can only tell you what's there, not provide a mechanism for changing the value.

If there is a way to set driver, (or approvers for that matter) I'm stuffed if I can work out how to do it :-)

Someone asked almost the same question in this thread in the Developer's Community about adding approvers to versions via the REST API. I just told them the functionality doesn't exist yet.

There is a single feature request JRACLOUD-25586 related to the versions APIs, but that's it. Maybe raise a new feature request to add the ability to set the version driver and approvers via the REST API.

Like Rees_ Ian likes this
Rees_ Ian March 4, 2024

Thanks David, I have come to the same conclusion in that you can Get it but not set it.  

0 votes
Rees_ Ian May 3, 2024

This is a message I got from Atlassian support 7/2/2044.  The driver can be fetched by adding ?expand=driver but it doesn't provide a way to update the driver. This is even more frustrating because if you create a fix version with automation, it appears that there is no way to set the Release Driver !!

 

I understand that you're looking to access a Jira version's "driver" field through smart values for your automation rule. However, currently, there's no smart value for the version's driver property. This is due to the recent introduction of the "Version Driver" feature, which has not yet been fully integrated into Jira's REST API.

There is already a feature request open with Atlassian to incorporate this feature into the API. You can track the progress of this request at the following link: https://jira.atlassian.com/browse/JSWCLOUD-25586. I would encourage you to add yourself as a watcher on this issue to receive updates via email as our development team works on it. Once this issue has been resolved the smart value for the driver field will additionally be accessible.

Suggest an answer

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

Atlassian Community Events