It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Russell Stadler I'm New Here Apr 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

0 votes
Payne Seal Community Leader Apr 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Service Desk

4 changes to queues and issues you don’t want to miss

Hello Atlassian Community! I'm Tania, a Senior Product Marketing Manager for Jira Service Desk Cloud! I'm excited to announce some exciting improvements coming up for those who work with queues and...

605 views 9 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you