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
One thing you can do is cache the results of /issue/createmeta (https://developer.atlassian.com/static/rest/jira/5.2.9.html#id244429) (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": [ "set" ] }
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: https://jira.atlassian.com/plugins/servlet/restbrowser#/com-atlassian-jira-rest-jira-rest-filter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As a supplement to this comment, perhaps the following documentation may help:
- https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.