Hi,
there is a requirement where 1 date field needs to be editable only for few users in a group or maybe not editable removing it from edit screen is not helping as it is getting removed from view screen as well cant use workflow as its not based on transition
tried to use ScriptRunner for the same with below script but its not working can anyone help with correction of the script-
const user = await makeRequest("/rest/api/2/myself");
const { accountId } = user.body;
const getRoles = await makeRequest(`/rest/api/2/user/groups?accountId=${accountId}`);
const roleNames = getRoles.body.map(({ name }) => name);
const role = "name of security group";
if (!roleNames.includes(role)) {
getFieldById("customfield_10534").setReadOnly(true);
}
Hi Sanjivani,
You can achieve this requirement using the Behaviours feature of ScriptRunner for Jira Cloud.
We have an example script here that shows how to make fields read-only to users in specific groups, and you will be able to update this to achieve your requirement.
Regards,
Kristian
Hi Sanjivani,
You can have separate Edit and View screens. Leave the field on the View screen and remove it from the Edit screen.
Then create a self-looping transition on the status with Conditions that allow only certain people to execute the transition.
Then add a transition screen with the field on the screen to the transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk
removing it from edit screen is not helping as it is getting removed from view screen as well , also cant use workflow as its not based on transition if the field is in same status anyone can change it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to create separate screens for Edit and View. Then leave it on the View screen and remove it from the Edit screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.