Forums

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

Jira Cloud, updating custom field using add post function

Igor Koposov November 5, 2018

Hi, everyone!

 

I need to update a customfield (Version Picker, id - 10049) using post function "Update Issue Custom Field" and set there "earliestUnreleasedVersion()", when somebody transit issue from one status to another.

 

How can I do this? Should I use REST API? Or is there easier solution?

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2018

Hello Igor,

As you can see on this answer, you can use the plugin Script Runner and configure the following Script to get this functionality:

import com.atlassian.jira.component.ComponentAccessor

def versionManager = ComponentAccessor.getVersionManager()
def projectManager = ComponentAccessor.getProjectManager()
def project = projectManager.getProjectObjByKey("JRA")

def versions = versionManager.getVersions(project)

versions.sort {it.releaseDate}.reverse().find{! it.released}

 Please, let me know if it works for you.

Igor Koposov November 5, 2018

Sorry, we don't have Script Runner yet :(

Is this the only solution?

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 6, 2018

Hello Igor,

Unfortunately, that was the only solution I was able to find to achieving it.

Maybe there are other possible workarounds for this using other plugins, but not natively on JIRA.

Igor Koposov November 7, 2018

But, how should work this feature?

Screenshot_26.png

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 7, 2018

Hello Igor,

The post function Update Issue Custom Field works well to update a field with a specific value, the current user (When talking about user picker fields) and current date/time (When talking about Date/time fields), however, it does not have a macro to specifically set the earliest Unreleased Version to a field.

Igor Koposov November 12, 2018

ok, thanks!

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2018

You are welcome, Igor.

Have a nice week!

Suggest an answer

Log in or Sign up to answer