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 ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.