Forums

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

Simple Groovy initialiser to set comment type tab to internal

Steve Letch August 12, 2019

Hi

 

I know this is a widely discussed topic but I cannot find a simple script to switch the tab to internal comment on a transition screen.

 

This requirement is because agents are required to log time at the triage step on a transition screen but managers want to ensure the comment being public is intentional.

 

People used to do this with the javascript in the description of the field but that's not possible any more.

1 answer

0 votes
PD Sheehan
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.
August 12, 2019

That may be a good suggestion for a feature enhancement to behavior.

But why couldn't this be achieved with javascript in the description?

This works in a simple test (using announcement banner for applying globally)

<script>
AJS.$(document).ajaxComplete(function () {
AJS.tabs.change(AJS.$('.js-sd-internal-comment').find('a'));
});
</script>
Steve Letch August 13, 2019

Because sadly they disabled javascript in field description in version 7

 

JS was the first thing I tried when I saw posts about it.

PD Sheehan
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.
August 13, 2019

I'm on 7.13.2 and have no problem using javascript in field descriptions. 

I see other posts about it being disabled... but I'm not sure why my environment still works.

That being said... I don't typically use field descriptions for javascript injections.

You could just create a Script Fragment via scriptrunner and deploy your own javascript file in a given context.

Steve Letch August 14, 2019

We're on 8.2.3. I'll try your script now and let you know.

Steve Letch August 14, 2019

Nope, gets ignored.

Suggest an answer

Log in or Sign up to answer