Jira Service Management does not have a field for group picking for their forms (not that we have found at least) and I want to make a custom tool to keep a regular single select list updated with all of our groups.
I have got the groups easily enough, but cannot figure out how to take the array and push it to the custom field.
There is one API call I haven't been able to try since it asks for a "Context ID" which is something that I can neither find nor get in another API call (it just says my custom field doesn't exist, which it does).
Has anyone had any experience trying to do what I'm doing? Take an array of strings and make it the list on a custom field in Jira.
Thanks in advance!
Hi @shardern --
To get the Context ID, you need to click on "context(s)" link for your field in the Custom Fields list:
Then click on the Create, edit or delete contexts link:
And finally, click on Edit context:
The "Context ID" will be in the URL of this page as fieldConfigSchemeId, for example:
https://YOURSITE/secure/admin/ManageConfigurationScheme!default.jspa?atl_token=LONGSTRING&customFieldId=10058&fieldConfigSchemeId=10158
Alternately, if you know your customFieldId (there's many ways to find this) you can use this API call to see the context(s):
/rest/api/2/field/{fieldId}/context
I hope this helps!
By the way, if you don't know what Contexts are... you can read up on them here:
tl;dr: Multiple contexts are useful if you want to use the same custom field with different sets of options for different projects or issue types.
Like say for one project you want to have certain groups as options, and in another project, you want a different set of groups. Using two different contexts would allow you to use the same field (this is a Good Thingâ„¢ in Jira administration).
That's why you need to specify a Context ID when adding options. They want to know which set of options. When they are created, every custom field starts out with just 1 default context.
Hi Darryl
Thanks for the response. We had looked in the URL, but just never thought that the context ID would be config scheme id. Have to say, thats really unintuitive on Atlassian's part.
My other problem with the api call to get the context id was that the response always returned 404 for some reason.
I'll see if I can make progress using the context ID now that I know what it is since that (i hope) was the only bit blocking me.
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OH! I forgot to mention, it's so annoying but the field ID has to be specified like so:
https://YOURSITE.atlassian.net/rest/api/2/field/customfield_10120/context
Totally lame - {fieldId} totally sounds like it should be a number.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That probably explains why it couldn't find the custom field I made. The one thing Atlassian really needs to work on is the API and its documentation.
That'll be really handy. Thanks again
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.