Create issue with direct HTML *specifying fields by value instead of key*

aaron_alpert June 5, 2024

I am trying to create a one-click issue creation link in another (non-Jira) app. I start with

https://<my Jira domain>/secure/CreateIssueDetails!init.jspa?

and from there append a bunch of key/value pairs. For one of the key/value pairs, it exists in Jira as a Select List. For example, say that custom field 10001 has options

  • id=10237, value=Blue
  • id=15466, value=Red
  • id=16444, value=Green

In the originating app, I have the values, so what I'd really like to do is append my link with

customfield_10001=Blue

However, Jira expects the ID, as shown below:

customfield_10001=10237

How can I either get Jira to accept the value (e.g., Blue) instead of the ID (e.g., 10237) in the issue creation link, or how can I do some kind of dictionary look up to find the ID of a given field/value pair? Note that the Select List options change frequently, so it will be impractical to hard code a dictionary.

 

Thanks!!

2 answers

0 votes
aaron_alpert June 13, 2024

What I ended up doing --

 

The "values" I have are actually users in a Quickbase table (Quickbase is a 3rd party database). I use the user search API (rest/api/3/user/search) with { 'query' : 'name@company.com' }, looping through each of the users in my Quickbase table and their respective email addresses. In the response, I have the accountId, which is written back to the Quickbase table. This script is implemented in a JLN notebook in Nebari and runs nightly at 11pm, so that new users get their Jira account ID's copied to the Quickbase table.

 

Now, I can have Quickbase compose a URL, starting with https://<my Jira domain>/secure/CreateIssueDetails!init.jspa? and appending assignee=<Jira account ID>

0 votes
Gyeorye Lee June 5, 2024

Hi Aaron.

Have you tried with customfiled_10001.value or  customfiled_10001.name?

aaron_alpert June 6, 2024

Thanks for the suggestion. Unfortunately neither customfield_10001.name=Blue nor customfield_10001.value=Blue worked. I tried a few other things, such as moving the .name and .value around, and enclosing Blue in quotation marks. On the plus side, it also didn't give me the "Specify a valid value for 'Color'" error, which happens when customfield_10001=Blue. Instead, it just leaves the field as the default blank value.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events