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: 

Updating the component name in the script gives me a error

Uthra Narasimhan
December 9, 2017

I am using Jira cloud ,  I would like to update the component field using the script, but doing so gives me the error below:

400: {"errorMessages":[],"errors":{"components":"Component/s is required."}}

Here is my script:

 

def issueKey = 'JTP-1'
def newSummary = 'Updated by a script'

def result = put('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.body([
fields:[
summary: newSummary,
description:"some random stuff",
components:[{
name: "TestUI"}]
]
])
.asString()
if (result.status == 204) {
return 'Success'
} else {
return "${result.status}: ${result.body}"
}

If I remove the components the other two summary and description gets updated without any issues

Please note that I am using lira cloud and any help with a example script would be really appreciated. Thank you.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Gaston Valente
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.
December 12, 2017
TAGS
AUG Leaders

Atlassian Community Events