25 lines
587 B
Groovy
25 lines
587 B
Groovy
/*
|
|
Workflow: CS: Workflow 4 SD
|
|
Transition: Ticket lösen
|
|
*/
|
|
|
|
|
|
import java.time.LocalDate
|
|
|
|
// aktuelles Datum + 2 Tage
|
|
def newDueDate = LocalDate.now().plusDays(2).toString() // yyyy-MM-dd
|
|
|
|
// nur setzen, wenn noch nicht vorhanden
|
|
if (!issue["fields"]["duedate"]) {
|
|
def resp = put("/rest/api/3/issue/${issue["key"]}")
|
|
.header("Content-Type", "application/json")
|
|
.body([
|
|
fields: [
|
|
duedate: newDueDate
|
|
]
|
|
])
|
|
.asObject(Map)
|
|
|
|
assert resp.status == 204 : "Update fehlgeschlagen: ${resp.status} - ${resp.body}"
|
|
}
|