Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,035
Community Members
 
Community Events
185
Community Groups

How to restrict cloning to only a certain group in a workflow?

I have a workflow property key that denies the ability to clone: "jira.permission.create.clone.denied" with property value as empty, and it works fine. So I know the syntax 'jira.permission.create.clone' works.

Now I need a certain group to have permission to clone on the same workflow. I have followed these references Atlassian document , Hide-ui-element-built-in-script , and Previous asked questions but none are working. I've created a group called "Clone Access" and added my name to test. I should be able to clone.

In the workflow property key, I've removed the old one and tried:

  • jira.permission.create.clone.group='Clone Access'
  • jira.permission.create.clone.group with 'Clone Access' as the property value

Then I tried creating a Project Role, also called 'Clone Access" and tried using:

  • jira.permission.create.clone.projectrole=10500
  • jira.permission.create.clone.projectrole with 10500 as the property value.

In the project's permission scheme, I have tried both the Clone Access (group and project role) allowed in Create Permission. But the workflow property does the opposite effect where I am denied the ability to clone, which is weird. Is there a way to allow cloning permission to only a certain group?

In addition, I have attempted to use ScriptRunner's Hide UI Fragments, but the code hides the clone button from all projects even when I put this under Conditions:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.crowd.embedded.api.Group

def loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def groupManager = ComponentAccessor.getGroupManager()
def cloneAccess = groupManager.getGroup("Clone Access")
def cloneAccessUsers = groupManager.getUserNamesInGroup(cloneAccess)

//since the module returns true for entire instance, need to make conditions so that only 1 project and 1 issue type is denied cloning with only the group
if(issue.projectObject?.key != 'ABC' && issue.issueType.name != 'Bug'){
return false
if(cloneAccessUsers.contains(loggedInUsers)){
return false
}
}

Any suggestions?

1 answer

1 accepted

1 vote
Answer accepted
Dave Mathijs
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 03, 2023

Hi @Diana Gorv 

Here's a reference to a KB article: How to restrict issue cloning in Jira

Basically, it says: "Jira doesn't have a Clone permission, only a Create permission."

@Dave Mathijs Thank you for the quick response!

Oh I see!

My final solution for future users with similar questions:

  1. Create a group, call it "Clone Access", add you users to grant access to clone/create
  2. On the project permission scheme, add "Clone Access" to Create Issues
  3. On your workflow, on all the status, add properties "jira.permission.create.group" and in the Property Key "Clone Access". Save workflow draft

 

One more question, does this workflow property key also affect with ScriptRunner's listener scripts? For example, if there is a listener script that auto-creates an issue if a custom field was selected on the parent issue, does the workflow property key take precedence over Scriptrunner's custom scripts? Meaning, unless the user was in the Clone Access group, the listener script will not function?

Suggest an answer

Log in or Sign up to answer