I would like to have an issue field drop-down choices updated on demand by a script. We would need to know if this is possible through the JIRA python module, or any way through the API, and if yes, how.
I found this in the API documentation, but I’m not sure this is what I need:
curl --request PUT \
--url 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"globalId": "SomeGlobalId",
"myCustomLinkProperty": true,
"colors": [
"red",
"green",
"blue"
],
"notes": [
"Remote version links may take any well-formed JSON shape that is desired,",
"provided that they fit within the maximum buffer size allowed,",
"which is currently 32,768 characters."
]
}'
I unable to get property keys, I get empty answer for the request
https:/your-domain.atlassian.net/rest/api/3/issuetype/1/properties
It is more like from time to time. Actually it is for VLAN selection in the ticket, and every time when our network team implements a new VLAN on network level, we would like to add that new VLAN to the options.
I tried that already, bit didn’t really find the one that is for this purpose. That’s why I created this thread. I did not start without any investigation. I also added what I found something like what I need, however I wasn’t able to make it work.
The API call you posted is for update properties for a specific Issue type which is not how custom fields get populated.
So your VLAN select field is probably a single-select list, correct?
If yes, did you create this custom field as part of an app you’ve build? Or did you just create it through the admin UI?
Honestly I’m not the JIRA admin, I just want to do the changes to it, thus, I’m not sure I know what exactly the differences are between issue type properties and custom fields. I suppose it was created through the admin UI.
Not sure if I was clear enough what we need to achieve. Let me try to clarify:
We have an issue type called ‘New server’. In this issue type, when people creating new tickets to request new servers, on the new ticket form they can select the VLAN to put their servers into from a drop-down menu. The list of VLANs can change overtime, when new VLANs are added to the network system, and we would like to automate the update of this selection in case the list changes.
Unfortunately, I believe there is currently no rest API to modify the options of built-in custom fields. There is only an API to modify the options of a custom field implemented by an add-on.
@david2 just made the point I was aiming for. If those are just regular custom fields made by your admin then there is no API yet that can update those options. I should have clarified that those REST API endpoints are for custom fields made by an app only.