Greetings, community!
I am searching for a solution to get all the option configured for a custom field via REST API.
A bit of context:
setting up an automation, where
WHEN option A, B or C is selected for the customfield in Main project
A corresponding task is created in project A, B or C
Hence the idea:
- send a web request for all the options of the field
- for each smart value with the body of the response compare if field input equals one of the smartvalue options
- trigger following processes
Is this the one you are looking for to get the available options for a custom field:
Kind regards,
Bill
kind of. problem is - can't figure it out with contexts. cannot call them correctly so as to specify context id path
always get a 405
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy even earlier:
my customfield has and ID 10071
even the request of rest/api/2/field/10071 leads me to 405 error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The expression should look like this, such as called from a browser, substituting in your values:
Your Jira URL/rest/api/3/field/customfield_12345/context/67890/option
If this is for one context, you could call this manually to identify the value for that second id number (the context):
If it is multiple, you would need to identify the correct context for the call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy call was rest/api/3/field/customfield_10071/context/
yet the response was
{"errorMessages":["The custom field was not found."],"errors":{}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could this be due to it being for a work management?
the custom fields from that project aren't also visible in administration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That sounds likely, but I do not know as I am not using JWM. My suggestions were targeting Jira Cloud features.
You could try searching in the developer community to see if there are related questions / solutions: https://community.developer.atlassian.com/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've found that in automation, in order to dynamically create a card in a project, you need to use the project ID as a smart value, rather than just the project name or project key. (i.e. if I create a variable called {{proj}} and set it to a key like "MH" it won't work, but if I set it to a id like "10015" it will)
With this being the case, I'd suggest either using a lookup table in your automation to link the field values to project ids or, if you have Premium, creating a table in Assets to do something similar.
This has the downside of not dynamically updating as values are added and removed from the field, but the upside letting you use human readable values in your field!
I've done this recently with a custom field, Teams, and an object in Assets that holds the values from the field along with a project id:
And then in the automation, I go lookup the Asset using AQL and use the value I get back from that to create a ticket in the appropriate project:
It would be probably easier to create a lookup table to do this but
1. A lookup table is stored per automation, so if I want to do similar things in different spots that is more tables I have to keep updated
2. I can extend the Asset schema to hold additional info that I can dynamically put in the created card, like Categorization, Labels, Assignee, or Priority.
Of course, if you don't have Premium, lookup tables are your only option!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that is a beautiful solution. though the downside of it not being dynamic is a dealbreaker
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.