You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I am going through the features of ScriptRunner particularly, behavior.
I am try to hide this custom field called X
customfield_10039: {
required: false,
schema: {
type: "number",
custom: "com.atlassian.jira.plugin.system.customfieldtypes:float",
customId: 10039
},
name: "X",
key: "customfield_10039",
hasDefaultValue: false,
operations: [
"set"
]
},
I used an example behaviour script
/*
* Note: You should run this script by selecting "On load" in the check box above.
* Make sure to change the priority in your script if you are affecting a different field.
*/
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);
/* Select role for priority field to be displayed... */
const role = "administrators";
if (!roleNames.includes(role)) {
getFieldById("priority").setVisible(false);
}
This works fine as there is no priority field
However, if i change it to X
Hi Joseph,
Thank you for your question.
I can confirm that inside ScriptRunner for Jira Cloud, number fields with the key of
"com.atlassian.jira.plugin.system.customfieldtypes:float"
like you are using are not supported by Behaviours, which is why you cannot hide this field.
You can see the field types which are supported by Behaviours inside of the documentation page located here.
Also, if you have a use case to support Number fields, can you please raise it here so that our product manager can see this and review it.
I hope this information helps.
Regards,
Kristian
Thank you Kristian.
I didn't even know that all custom fields type weren't supported.
Thank you
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.