Allow a group to be able to copy sys_id in incident header

btreseder
Kilo Expert

I have a group that is unable to see the "Copy sys_id" link when right clicking the incident header.   How do I allow them access to that function?   Do I need to create a new ACL?

1 ACCEPTED SOLUTION

A much simpler way may be to just make a custom UI Action that calls the same copyToClipboard function.   This would then not have an impact on future upgrades.



CopySysID.png


View solution in original post

11 REPLIES 11

I apologize, the solution I provided would only grant them access to copy the sys_id from a list view.   To give them the ability to copy it from the form header, you would need to modify the UI Macro called "context_form_header".   There is a section at the bottom that looks like this:



          <j2:if test="$[jvar_session.hasRole('admin')]">


                gcm.addHref("${gs.getMessage('Copy sys_id')}", "copyToClipboard('$[${ref}.sys_id]');");


                gcm.addHref("${gs.getMessage('Show XML')}", "xmlView('${ref}', '$[${ref}.sys_id]');");


          </j2:if>



You would need to change the conditions to allow them access here.   Perhaps something like this:



          <j2:if test="$[jvar_session.hasRole('admin') || jvar_session.hasRole('Service_Desk')]">


                gcm.addHref("${gs.getMessage('Copy sys_id')}", "copyToClipboard('$[${ref}.sys_id]');");


          </j2:if>


          <j2:if test="$[jvar_session.hasRole('admin')]">


                gcm.addHref("${gs.getMessage('Show XML')}", "xmlView('${ref}', '$[${ref}.sys_id]');");


          </j2:if>



Please note that this change could affect on upgrades to this macro and would need to be reviewed for impact in future releases.


A much simpler way may be to just make a custom UI Action that calls the same copyToClipboard function.   This would then not have an impact on future upgrades.



CopySysID.png


That worked much better and I like the idea of no upgrade wammies!   Thank you for your help.


Hi John,



I know this post was a while ago - but hoping you can help me.   I'd like to create a new UI Action to call the 'copyTo Clipboard' function as you have suggested, but I'm not familiar enough with coding to create this.   Are you able to assist with what this UI Action would look like?


Hello John,

 

i have the req to allow  specific role to copy sys_id from the headers , i've updated Context menu ( copy sys_id) it allowed the role to copy from the list only.

Can you please write the solution again, the print screen you've attached 4 years ago does not work.

 

Thank you in advance,

Eitan