Creating an issue using custom fields NAME instead of ID?

In your docs you explained how to create an issue using custom fields.
In your examples:

"customfield_11050" : {"Value that we're putting into a Free Text Field."}

So my question is, how can I set some custom field if I don't know ID and I know it's NAME.
I would like to do something like this:

"customfield_NAME_OF_THAT_FIELD" : {"Value that we're putting into a Free Text Field."}

Can you give me some advice how to do that?
Thank you

2 answers

2 votes

One thing you can do is cache the results of /issue/createmeta ( (make sure you pass in the expand=projects.issuetypes.fields query param to expand the fields. The response will give you the metadata available and required to create an issue. You'll find the fields in an array with customfields that look like this:

"customfield_10250": {
              "required": false,
              "schema": {
                "type": "string",
                "custom": "com.atlassian.jira.toolkit:message",
                "customId": 10250
              "name": "Support Request Message (IssueType:Bug)",
              "operations": [

Extract all of your customfields by name then cache their keys so you don't have to look them up on every issue creation.

You can play with the API here:

Thanks this was what I was looking for

Hi Ben,

Looking at your inquiry here, I believe that you are trying to create an issue using JIRA REST API. If this is true, then I am afraid that it is only possible for us to assign a value to a custom field during issue creation using the custom field ID. I have tried this before, and if I am not mistaken it is not possible for us to supply the field name in the JSON data.

I hope that this clarifies the matter.

As a supplement to this comment, perhaps the following documentation may help:


Hi Ahmad,

I forgot to mention that I'm using JIRA REST API. Sorry about that.
So there is no other way to do that without using customfield_id?
One more question:
Is "Environment" field default for all your accounts on Jira?
I mean does everyone have field with id:"environment", name:"environment"?

Can I please get update for my last question?
thank you

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,731 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you