Hi, I am trying to copy the values in the multi-user picker field to watcher field in JIRA cloud but the value I am getting is always null. Here is the implementation:
def input1CfId = 'New Watchers'
def outputCfId = 'Watchers'
logger.info("${input1CfId}")
logger.info("${outputCfId}")
def customFieldUsers= get('/rest/api/2/issue/' + issue.key).
asObject(Map).body['fields']['New Watchers']
def input1 = issue.fields[input1CfId]
def input2 = issue.fields[outputCfId]
logger.info("${customFieldUsers}")
logger.info("${input2}")
def output = input1
logger.info("${output}")
if (output == (issue.fields[outputCfId])) {
logger.info("already been updated")
return
}
put("/rest/api/2/issue/${issue.key}/watchers")
//.queryString("overrideScreenSecurity", Boolean.TRUE)
.body([
"watchers" : [
"name" : output
],
])
.asString()
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.