Bhavya-org / Scripts

0 stars 0 forks source link

edit issue for single choice and label type field for subtask #35

Open Bhavya-ss opened 3 weeks ago

Bhavya-ss commented 3 weeks ago

def issueKey = issue.key def issuetype = issue.fields.issuetype.name

if (issuetype == "Sub-task") { def result = put("/rest/api/2/issue/${issueKey}") .header('Content-Type', 'application/json') .body([ fields: [ customfield_10005: [value: "Normal"], customfield_10248: ["TPL"] ] ]) .asString()

if (result.status == 204) {
    println("Issue ${issueKey} successfully updated.")
} else {
    println("Failed to update issue ${issueKey}. Status: ${result.status} ${result.body}")
}

} else { println("Issue ${issueKey} is not a sub-task.") }