Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Seeking Assistance for Field Restriction Automation in Jira Cloud

Ahmed Saci November 14, 2023

Hello Atlassian Team and Community Members,

I am reaching out for assistance or advice on a specific challenge I am facing in Jira Cloud.

I am currently working with Jira Cloud and am looking for an automation solution, possibly through JMWE (Jira Misc Workflow Extensions), JMCF (Jira Misc Custom Fields), or ScriptRunner, to implement a specific rule. My goal is to restrict editing of certain fields for certain users, making these fields read-only for them.

I am particularly interested in finding out if anyone has successfully created a script or automation to address this use case in Jira Cloud. Any help, script examples, or pointers to relevant resources would be greatly appreciated.

Thank you in advance for your time and expertise.

Best regards,

Reda

3 answers

2 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
November 15, 2023

Hi Ahmed,

I can confirm that the Behaviours feature inside of Scriptrunner for Jira Cloud will be able to help with your requirements.

An example script here shows how to restrict issue types to users in a specific project role.

You can modify this to achieve your requirements by replacing the restrict issue type API calls with calls to make the fields you want to make read-only, and I can confirm our documentation page here shows how to make a field read-only. 

In the linked example, just replace the logic inside the if block where the optionsVisibility is being set on the issue type field to add a line for each field you want to set to read-only.

It is worth mentioning behaviours only works on the Global Create view and the Global issue view, and issue views of the board view and backlog view currently but does not currently support transition views. 

To see what views are supported as they are added, you can follow the documentation page here.

I hope this information helps.

0 votes
Answer accepted
Trudy Claspill
Community Champion
November 14, 2023

Hello @Ahmed Saci 

Recently Adaptavist (makers of ScriptRunner) announced an update to their Behaviours app such that it can now be used on the issue View screen to modify some fields. Unfortunately due to limitations in the APIs provided by Atlassian they are currently able to modify only the View screen when it is viewed fully as a browser tab. They can't yet modify the screen when it pops up as a modal.

For more information you can check out their announcement here:

https://www.scriptrunnerhq.com/inspiration/blog/behaviours-arrives-for-issue-view-plus-2-other-announcements

Kristian Walker _Adaptavist_
Community Champion
November 15, 2023

Hi Trudy,

I can confirm we have now released support on the issue view screen for the backlog view and board view as mentioned in our documentation page located here.

Regards,

Kristian

Ahmed Saci November 22, 2023

@Trudy Claspill @Kristian Walker _Adaptavist_ thank you so much for your answer it worked.

I set up a script in script runner behavior which allows me to do that.

Kristian Walker _Adaptavist_
Community Champion
November 22, 2023

Hi Ahmed,

I am glad you got it working.

Can you please mark mine and Trudy's answers as accepted to help show other users that this is a correct answer.

Regards,

Kristian

1 vote
Andrei Cuzuioc _ScriptRunner_
Contributor
January 13, 2025

hey @Ahmed Saci ! 

Behaviours feature is now supported on Transition View in Jira Software Cloud. You can check the details of this first release, supported fields as well as demo videos here.

Best regards,

Andrei

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events