Hello, im using scriptrunner for restriction of customfield change by users that isnt members of jira-administrators group, on existing tickets it works fine, but now im trying to do it for new tickets, i dont know how to setup correct value of customfield, im getting error:
body: {"errorMessages":[],"errors":{"customfield_10157":"Specify a valid 'id' or 'name' for Internal Severity","customfield_10158":"Specify a valid 'id' or 'name' for External Severity"}}
what should i use as customfield value? or maybe im doing another mistake?
by api request im getting this values of this fields that i should use:
from:10676, fromString:None (0) tried to use both, but still no effect.
Hi again,
I think you should use the External Severity value , I mean, Trivial (1), Low (2) ..... For example, I checked with a cf called "Severity" which has two possible values , ONE or TWO. Check my screenshots for clarifying it.
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
I can see some possible issues in your code:
fields: [
(customField.id):[value: "<OptionValueHere>"] as Map
]
In addition, to get what you want, this way is not ideal, and you could avoid having to perform these checks and conditions to see if the issue is being created or already exists by simply using two script listeners, one for the "issue created" event and another for the "issue updated" event.
I leave the documentation about the script listeners here: https://docs.adaptavist.com/sr4jc/latest/features/script-listeners
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for answer!
I know about group name and same id for customfields, already fixed it.
But for this error:
body: {"errorMessages":[],"errors":{"customfield_10157":"Specify a valid 'id' or 'name' for Internal Severity","customfield_10158":"Specify a valid 'id' or 'name' for External Severity"}}
still same, im using your example right?
def resp1 = put("/rest/api/3/issue/${issue.key}")
.header('Content-Type', 'application/json')
.body([
fields: [
(customfield_10157):[value: 10676] as Map
]
])
.asString()
this customfield is dropdown list of fixed values: i checked available values by api request and found 2 usefull id for needed default value:
from:10676, fromString:None (0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
o schedule a lash lift appointment in Winston-Salem using ScriptRunner, you can automate booking processes by running a script that interacts with the salon's online booking system, ensuring efficient and accurate scheduling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your Jira automation using Scriptrunner, ensure the accuracy of custom field IDs or try specifying custom field values using their names. For example, use field names like "Internal Severity" and "External Severity" instead of numeric IDs. Confirm that these custom fields are available in the field configuration associated with the project or issue type you are working with. Verify the field context to ensure they are applicable to the desired project and issue type. If the issue persists, consult the Jira REST API and Scriptrunner documentation for any specific requirements or considerations. It's advisable to test changes in a safe environment before applying them to a production instance. If additional information about your configuration is provided, more targeted assistance can be offered.
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.