We're using the following script (in a Listener) to update a custom field ("Last Comment") with the last comment on the issue. This is to make it searchable with jql and pull into reporting. It works, except it also sends an email out when it does the issue update.
Is there a way to suppress that notification email?
The script:
final lastCommentFieldName = 'Last Comment'
// Get last comment custom field id
def customFields = get("/rest/api/2/field")
.asObject(List)
.body
.findAll { (it as Map).custom } as List<Map>
def lastCommentCfId = customFields.find { it.name == lastCommentFieldName }?.id
// Updates the issue with the created comment body
put("/rest/api/2/issue/${issue.key}")
.header("Content-Type", "application/json")
.body([
fields:[
(lastCommentCfId): comment.body
]
])
.asString()
Hi Ryan,
Thank you for your question.
I can confirm that when calling the Edit issue API to update an issue field you can not send a notification by setting the *notifyUsers * flag to false as mentioned in the Atlassian API docs located here.
This means you would simply add in the line below into your rest call after the .headers line to skip sending a notification.
.queryString("notifyUsers":false);
I hope this helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.