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

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 Leaders.
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 Leaders.
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events