Hi all,
I am trying to use listeners to clear the field value for some fields as soon as the issue gets updated.
The fields which I want to have cleared are in another tab. Nevertheless, I have listet them as below.
// get custom fields
def customFields = get("/rest/api/2/field")
.asObject(List)
.body
.findAll { (it as Map).custom } as List<Map>
def toUpdate1CfId = customFields.find { it.name == 'Compliance Risk' }10257
def toUpdate2CfId = customFields.find { it.name == 'GDPR Risk' }10258
def toUpdate3CfId = customFields.find { it.name == 'Business Risk' }10259
def toUpdate4CfId = customFields.find { it.name == 'technical Risk' }10432
def toUpdate5CfId = customFields.find { it.name == 'Compliance Prio' }10260
def toUpdate6CfId = customFields.find { it.name == 'GDPR Prio' }10261
def toUpdate7CfId = customFields.find { it.name == 'Business Value' }10262
def tomorrowStr = (new Date() + 1).format("yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("UTC")) // date format in iso8601
def resp = put("/rest/api/2/issue/${issue.key}")
.header('Content-Type', 'application/json')
.body([
fields: [
(toUpdate1CfId): 'NULL',
(toUpdate2CfId): 'NULL',
(toUpdate3CfId): 'NUKK',
(toUpdate4CfId): 'NULL',
(toUpdate5CfId): 'NULL',
(toUpdate6CfId): 'NULL',
(toUpdate7CfId): 'NULL'
]
])
.asString()
assert resp.status == 204
Also, defined the trigger as seen in the screenshot.

Do you have any experiences on this? Any advice how to make this work?
Thanks a lot!
Best,
Xheneta from Munich