The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Hi Team, i want to move the issue from one transition to another.

Shrikant Maheshwari
September 24, 2018

Hi team, i want to move the issue to another transition , below is the code written but its not working, can someone please help.

 

def issueKey = issue.key
def result = post("/rest/api/3/issue/DCEOCG-202/transitions")
//.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
.body([
"transition":{
id: {"261"}
}
])

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
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 Champions.
September 24, 2018

What does "not working" mean?  What error response do you get?

Shrikant Maheshwari
September 25, 2018

Hi Nic,

I am trying to move the issue from one transition to another and there is a field present at that transition, so i want to update the field also, for which i have written the below script and getting the error message as  -

 

"body: {"errorMessages":[],"errors":{"recommendationExplanation":"Field 'recommendationExplanation' cannot be set. It is not on the appropriate screen, or unknown."}}"

Script - 

def issueKey = issue.key
def recommendationExplanation ="customfield_26896"
def result = post("/rest/api/3/issue/DCEOCG-215/transitions")
.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
.body([
'transition' : ['id' : '21'],
'fields' : [recommendationExplanation : ['value' : 'NA' ]]
])
.asString()

Nic Brough -Adaptavist-
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 Champions.
September 25, 2018

You mean change status - issues do not have a transition, they are actions that change the status.

Anyway, the error message you are getting is clear.  Your action is to transition from one status to another, using the transition between the two that has an id of 21.  You are giving it the a field, but that field is not on the transition screen for transition 21

You should check

  • That the transition has a screen
  • The screen includes the field you want
  • That you are using the right name for the field.  It's very unlikely that the field's id is recommendationExplanation - it's probably more like customfield_12345
TAGS
AUG Leaders

Atlassian Community Events