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

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 Leaders.
December 12, 2017

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events