It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how can i make summary field editable only for certain role

I want to make restriction for edit summary field to be editable only for same roles for the whole projects.

 

I used behaviours to make the field readOnly with expect condition to that role it works but it will be restricted for the whole (Create, view and edit). 

 

There is another way to do this ? 

2 answers

2 accepted

1 vote
Answer accepted
Ivan Tovbin Community Leader Nov 07, 2019

Hi Mahdi,

There's a way to achieve this. Not the most elegant solution, but it works.

1) Remove 'Summary' field from issue 'Edit' screen

2) In your workflow create a GLOBAL transition, that lead to ITSELF. That way it will be available in every status, but won't change the current status once used.

3) Add a screen to that transition with 'Summary' field

4) Add all neccessary conditions to that transition, to make it available only to certain project roles.

Now your 'Summary' field will be editable ONLY through that transition. Transition conditions will make sure it's only available to required project roles.

Hope this helps.

Hey Ivan,

This will work, but it's huge stuff I have many projects with different workflows certainly there is another optimized solution using scriptrunner or bevaiours that's why I'm asking the question 

Ivan Tovbin Community Leader Nov 07, 2019

Behaviors could be the solution, but it'll require some fine tuning, like specifying actions (screens) where you want 'Summary' to be editable for everyone (like Create screen). Other than that I don't really see a problem with behaviours. Please let me know if you need help with the code.

Yes, I'm focusing on behaviours, i added a behaviour to the summary filed I make it read-only with a condition for some roles and I mapped for all the projects the problem now I didn't get the part to make this happen only on the edit screens because in this way even when you create the issue you must be part of the role users.

Do I'm on the right way? 

Ivan Tovbin Community Leader Nov 07, 2019

You are doing it almost right. You need to check that this is NOT a 'Create' transition:

if (getAction().getId() != 1){
.....
}

1 is always the ID of 'Create' transition. 

Like Mahesh Kallepalli likes this

Thank you very much, Ivan, it works fine ;)

1 vote
Answer accepted
Leo Community Leader Nov 07, 2019

Hi @Mahdi Challouf

Below snippet will do the trick for you on create screen, just include your user role condition along actionName in If or inside if

if(getActionName() != "Create"){
       getFieldById("summary").setReadOnly(true)
}

 

BR,

Leo

Hi @Leo thank you for your help it works too ;) 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

344 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you