Default Service Desk Comments to Internal

Atlassian community, we recently implemented JIRA Service Desk 2.0.2, and our team is very nervous about comments defaulting to "Respond to customer" versus "Internal comment".  They're very afraid someone is going to say, "This dummy doesn't know what he's talking about," and actually send that to the customer.  Is there a way to set it so comments default to "Internal comment"?

6 answers

Norman,

I had to run a Javascript interval to "look" for the comment tabs, because they don't exist on the page when it first gets loaded.  Below is the code I implemented in the announcement banner.

<script type="text/javascript">
var commentTabsAreAlreadyShowing = false;
setInterval(function(){
  var tabs = jQuery("#sd-comment-tabs");
  if (tabs.size() > 0 && !commentTabsAreAlreadyShowing) {
    commentTabsAreAlreadyShowing = true;
    jQuery(".js-sd-internal-comment").children("a").eq(0).click();
  }
  else if (tabs.size() == 0) {
    commentTabsAreAlreadyShowing = false;
  }
}, 100);
</script>

Works well. Thanks for this solution

Is this also for JIRA Cloud?

For JIRA 7, you can use this snippet:

<script type="text/javascript">
var commentTabsAreAlreadyShowing = false;
setInterval(function(){
  var tabs = jQuery(".sd-comment-buttons");
  if (tabs.size() > 0 && !commentTabsAreAlreadyShowing) {
    commentTabsAreAlreadyShowing = true;
    jQuery(".sd-internal-submit").parent("span").insertBefore(".sd-comment-buttons span:first");
    jQuery(".sd-internal-submit").addClass("aui-button-primary");
    jQuery(".sd-external-submit").removeClass("aui-button-primary");
  }
  else if (tabs.size() == 0) {
    commentTabsAreAlreadyShowing = false;
  }
}, 100);
</script>

Unfortunately, Atlassian has disabled javascript execution in the announcement banner.

I've updated the code to work with JSD 3.5 and JIRA 7.3.6, using the same idea as the original.

<script type="text/javascript">
var commentTabsSwapped = false;
setInterval(function(){
  var tabs = jQuery("#sd-comment-tabs");
  if (tabs.size() > 0) {
    commentTabsSwapped = jQuery(".js-sd-internal-comment").prev(".js-sd-external-comment").size() == 0;
    if(!commentTabsSwapped) {
        jQuery(".js-sd-internal-comment").after(jQuery(".js-sd-external-comment"));
        jQuery(".js-sd-internal-comment").switchClass("inactive", "active");
        jQuery(".js-sd-external-comment").switchClass("active", "inactive");
    }
  }
  else if (tabs.size() == 0) {
    commentTabsSwapped = false;
  }
}, 100);
</script>

I updated your code to make a switch back possible to an external comment:

 

 

<script type="text/javascript">
var initialTabHighlightSwapped = false;
function checkJSDCommentTabs () {
var tabs = jQuery("#sd-comment-tabs");
if (tabs.size() > 0 && !initialTabHighlightSwapped) {
switchJSDCommentTabHighlight();
initialTabHighlightSwapped = true;
} else if (tabs.size() == 0) {
initialTabHighlightSwapped = false;
}
}

function switchJSDCommentTabHighlight () {
jQuery(".js-sd-internal-comment").click();
}

var intervalFunct = setInterval(checkJSDCommentTabs, 1000);
</script>

Setting a default value is still an outstanding issue for JIRA.    https://jira.atlassian.com/browse/JRA-9091

There are two possible solutions though.   The first is paid plugin.

https://marketplace.atlassian.com/plugins/com.redmoon.jira.comment-security-default

The second is doing some creative javascript code.

https://developer.atlassian.com/display/JIRADEV/How+to+Set+Default+Comment+Security+Level

Norman, sorry it took so long to get back to you. This doesn't work for me, because the issue is with Service Desk and the whole "Respond to Customet" vs. "Internal Comment" tabs. There is no comment level select to grab.

The tabs corresponds to the security level, so you can add some javascript to make sure that the internal tablis either first so it selected by default or force the internal comment tab to be highlighted when the comment button is clicked.

I guess this is no sultion for JIRA Cloud?

Andrew Lui Atlassian Team Jul 21, 2016

Note, the document: https://developer.atlassian.com/display/JIRADEV/How+to+Set+Default+Comment+Security+Level, which is linked above, is no longer available. The JavaScript described in the document is not supported by Atlassian, and the JavaScript no longer works with JIRA 4.2+ anyway.

The issue listed above is not actually for what the question addresses.  The correct issue to vote on is here: https://jira.atlassian.com/browse/JSD-1733

There is a new Add-On available. It is called Doublecheck for JIRA Service Desk and is available at https://marketplace.atlassian.com/plugins/com.accxia.sd.plugins.tailor.tailorman-sd-confirm/server/overview

It is not changing the default behaviour. Instead, for better user experience it simply adds a confirmation dialog whenever a user is about to send a comment to external customers.

  • Adding comment in Edit
  • Adding Comment in Workflow Transition
  • Adding Comment in Issue View
  • Adding Comment in Link Issue View

@Ryan Hoke,

 

Off topic, but have you ever considered finding out why your support engineers think about your customers the way they do, if they actually write things down like "This dummy doesn't know what he's talking about"?  ;-)

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

381 views 1 13
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot