Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I set the comment type to Internal with Behaviours and Jira Service Desk?

Russell Stadler April 22, 2019

While the Adaptavist docs have some useful notes about using Behaviours with JSD and also how to make "Internal Comments" with a script, I wasn't able to find something indicating how to use Behaviours to specify the use of an "Internal Comment" instead of "Respond to Customer" on a Transition Screen.  

It seems like this is probably possible, but I'm struggling on figuring out how to go about it.  

The goal here is that I want to have a particular Transition Screen default to an Internal Comment prompt.  

1 answer

1 vote
Payne
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 Leaders.
April 23, 2019

I'm doing something similar that you may find useful if you don't find a way via Behaviours.

I've got a validator set up to make sure that a comment is internal, and not external, on a particular transition:

import groovy.json.JsonSlurper
import groovy.json.JsonParserType

def returnValue = true

def commentProperty = transientVars?.get("commentProperty")?.toString()
//commentProperty will look like this: [[{key: "sd.public.comment", value: {internal: "true"}}]]

if (commentProperty != null) {
//strip the leading [[ and trailing ]] from the string
commentProperty = commentProperty.substring(2,commentProperty.length()-2)
//set Type to LAX to compensate for the fact that not all of the strings are surrounded by quotes
def props = new JsonSlurper().setType(JsonParserType.LAX).parseText(commentProperty)
returnValue = props.key == "sd.public.comment" && props.value["internal"] == "true"
}
else {
returnValue = true
}

return returnValue

So, if an agent attempts to create an external comment, he gets the error, The comment should be an Internal Comment., and he simply changes it to an internal.

The code generates a couple of static type checking warnings in the editor, but they can be ignored.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events