Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get field type for component field using REST API?

SUNGSU AN
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 22, 2022

Hi Jira experts,

When a new issue is created under a project in Jira system, for some projects, 'components' field which is system field is set as mandatory but for other projects, it is set as optional.
So, when a user create new issue under a project in Jira system, I need to get this information so that I will ask a user to select a value in 'components' field.

I tried to change the REST API URL below to get the field type of 'components' field. But, I was not able to.

https://jira.*****.com/rest/api/latest/issue/createmeta/10103/issuetypes/10304/components

Would you please help how to change this URL to get this information from 'components' field?

 

Thank you for your help in advance.

Joseph 

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2022

Welcome to the Atlassian Community!

The "field type" of the component/s field is "components".  It's a unique system field type, not a custom field type of which you can add many.

0 votes
Tom Lister
Community Champion
November 23, 2022

Hi @SUNGSU AN 

Component can be set as required at a project level using the Field Configuration Scheme.

If you request the meta data with the expand = project.issue.fields option you can see if the  Component is required or not.

https://tom-dev.atlassian.net//rest/api/3/issue/createmeta?projectIds=10004&expand=projects.issuetypes.fields

 "components": {
"required": true,
"schema": {
"type": "array",
"items": "component",
"system": "components"
},
"name": "Components",
"key": "components",
"hasDefaultValue": false,
"operations": [
"add",
"set",
"remove"
],

Suggest an answer

Log in or Sign up to answer