ScriptRunner Web Fragments to change UI to disable cloning in 1 project?


Does anyone know if it is possible to use the new Web Fragments feature of ScriptRunner to alter the UI to prevent issue cloning in just 1 project? And if so, how?

Thanks in advance


3 answers

1 accepted

0 votes
Answer accepted

Hi Conor,

Our latest release includes a built-in script to allow you to conditionally hide UI elements (like the Clone button): (for JIRA 6.3/6.4) (for JIRA 7.x)

I hope you like it.

regards, Mark.

Thank you Mark! This is exactly what i needed.

I've implemented this for 1 of our projects and it works great!!

Super support as always from you guys smile

Hi Mark McCormack

I'm having some difficulty in finding how to get to go to Admin → Script Fragments


can you help me find it?

Sure thing: please try the Jira Admin (cog) --> Add-ons then find the ScriptRunner section and finally choose Script Fragments.

Alternatively you could try using "." (or even "g+g" or press g twice) and then type "Script Fragments".

I hope that helps.


The following script should hide "Clone" menu item for one project only. Tested in JIRA 7 and works fine.

  1. Select ScriptRunner "Script Fragments -> Install web resource". Provide details [screenshot attached]:hide-clone.png

    You can also check ScriptRunner web resources from here:

  2. The javascript file "hide-jra.js" contains the following code:

    (function ($) {
        $(function () {
             * Binding is required for link such as
             * http://localhost:8080/jira/projects/JRA/issues/JRA-4?filter=allopenissues
            JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(event, $context, reason) {
                if (reason === JIRA.CONTENT_ADDED_REASON.pageLoad || reason === JIRA.CONTENT_ADDED_REASON.panelRefreshed ) {
            //calling function for link such as: http://localhost:8080/jira/browse/JRA-5
         * Hide the clone menu
        function hideCloneMenuItem() {
            var projectKey = "JRA";
            var issue = JIRA.Issue.getIssueKey();
            if (typeof (issue) !== "undefined") {
                var currentProject = issue.substr(0, issue.indexOf('-'));
                if (currentProject == projectKey) {
    }) (AJS.$);


    I have used project key "JRA" for this example. 

Hi Ashraful,

I have the following based on your answer above -

  • created the script resource dir,
  • added the js script to it (updated the project key)
  • updated the args to pick up new directory
  • restarted JIRA
  • and added the web resource.

Unfortunately this does nothing (other than not throw an error, which at least confirms it's picking up my resource directory).

I'm running JIRA 6.4.7 (our org. is not able/ready to upgrade to JIRA 7 just yet)

Any ideas?

Kind regards





Hi - the script has been updated and it works fine in JIRA 6.4.7. I have removed "AJS.toInit" from 2nd line. After uploading the script you may need to restart the JIRA instance.


Not sure if you already implemented this.

1. Click on Hide system or plugin UI element 

2. type com.atlassian.jira.plugin.system.issueoperations:clone-issue in what to hide (Module key)

3. Put this condition !(jiraHelper.project?.key == "Project_Key") 


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


236 views 0 6
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