I want to hide a request type group for users within a particular JIRA group with ScriptRunner

Jessie Chia August 20, 2019

I have a list of users who are not to raise a particular set of request types under a request type group in the Customer Portal. As we already have ScriptRunner, I am trying to use a web resource (JS) to hide the element. However, the simple $("a:contains('Hardware')").hide() does not seem to be working =\

Tried to use a Web Panel at servicedesk.portal.footer but JS script does not appear at all either.

What am I missing? Would like to implement this without the need of any other addons. Thanks for the help!

1 answer

0 votes
Jean-François FORGET November 23, 2020

Hi @Jessie Chia ,

Did you made any progress on that topic?

I'm under same configuration as you. Jira + Script runner. I would be interested to get control over request visibility as well.

JF

Jessie Chia November 23, 2020

Hi @Jean-François FORGET 

We did not manage to get far since. We did, however, tried Extension for Jira Service <strike>Desk</strike> Management which is wonderful.

Eventually, we re-routed with a "whitelist" approach. 

  • Request type remains visible
  • We hide the "Create" button from view and display a message if the user is not in a particular Jira Group. This check and hiding is done using ScriptRunner's Behaviours, printing the following javascript&colon;
    <script>jQuery('input[value=Create]').attr('disabled', 'disabled');</script>

    E.g. getFieldById("fieldOnRequestTypeScreen".setDescription("<script>jQuery('input[value=Create]').attr('disabled', 'disabled');</script>");

Hope the above might come in somehow handy for you. Will be interested if you have the solution or a neater implementation.

Regards,
Jessie

Like Jean-François FORGET likes this
Jean-François FORGET November 24, 2020

Thanks for your prompt reply.

I never thought about injecting javascript with script runner behavior. Good to know, thanks. Even I may avoid using this kind of tricks.

 

The only "out of the box" feature I have is to use a script runner validator script that prevent the user to log the ticket if he his not allowed. But I can't hide the request type depending of the connected user.

Jeff

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events