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.
Hi!
Check if this link helps you:
https://docs.atlassian.com/software/jira/docs/api/REST/1000.1584.0/#api/2/issue-editIssue
You need to specify the components inside a "set"
"components": [ { "set": "" } ],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.