The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set Internal or 'to-customer' comment on Service Desk with groovy

Arianna Fabbri
Contributor
November 10, 2014

Hi,

is possible to update a Service Desk issue's comments setting comment's visibility?

Can I add a comment with groovy setting it as "Internal Comment" or "Respond to customer"?

 

Thank you

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Geert Graat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
November 10, 2014

Hi,

You can run a custom script in a post function to add a comment restricted to a specific role, in this case the Service Desk Team (Role ID 10101)

// add a comment restricted to Service Desk Team role
ComponentAccessor.getCommentManager().create(issue, userKey, "your comment", null, 10101 as Long, true)

If you do not restrict the comment, it will be visible for the customer.

Regards,

Geert

Arianna Fabbri
Contributor
November 10, 2014

Hi Geert, thank you so much for your quick answer. Just regarding your suggestion, I'm experiencing another issue: if you take a look to my question https://answers.atlassian.com/questions/10401665/duplicated-comment-added-during-transition I was just trying to solve the duplicated comments error deleting instruction issueInputParameters.setComment(transitionComment) and substituting it with ComponentAccessor.getCommentManager().create... But, if I use this instruction (commentmanager) my script doesn't execute properly. I've added the instruction after if (!transitionResult.isValid()) { log.debug "Transition result INVALID" }else{ .... here and: - the comment is correctly added only once - the assignee is not saved on new issue (without using commentmanager I have duplicated comments but everything is ok for the assignement). Have you any suggestion? Thank you again

Geert Graat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
November 10, 2014

Hi, I see I copied my code with the variables issue and userKey, issue is defined in your script, but you probably have to substitue authContext.getUser().getKey(). That will probably solve it.

TAGS
AUG Leaders

Atlassian Community Events