Forums

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

Why fetching custom field default values required Administer Jira permission?

Jakub Zimny December 2, 2022

Hello,
we are trying to fetch list of fields with its default values. We use following endpoint:

GET /rest/api/2/issue/createmeta

However, as also described in this question: https://community.developer.atlassian.com/t/how-to-get-default-value-for-message-custom-field-via-jira-rest-api/45002, response only contains hasDefaultValue property, and even if this property has value true, it does not contain defaultValue property. 

We tried to fetch default values using following endpoint:

GET /rest/api/3/field/{fieldId}/context/defaultValue

but it requires Administer Jira global permission. 

Is there any reason why it is restricted to administrators? And why doesn't /createmeta return defaultValue field? Is there any other way to access fields defaultValue?

Best regards,
Jakub Zimny

1 answer

0 votes
Phumi
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2022

Hi Jakub

It's Phumi here from Atlassian Support.

Can you try using the expand switch like this:


https://your-site.atlassian.net/rest/api/latest/issue/createmeta?expand=projects.issuetypes.fields

It should provide you with a response similar to the following with the "default" value at the bottom:

 "name": "Priority",
"key": "priority",
"hasDefaultValue": true,
"operations": [
"set"
],
"allowedValues": [
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/1",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/highest.svg",
"name": "Highest",
"id": "1"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/2",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/high.svg",
"name": "High",
"id": "2"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/4",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/low.svg",
"name": "Low",
"id": "4"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/5",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/lowest.svg",
"name": "Lowest",
"id": "5"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/10000",
"iconUrl": "https://your-site.atlassian.net/images/icons/priority_major.gif",
"name": "P1",
"id": "10000"
},
{
"self": "https://your-site.atlassian.net/rest/api/2/priority/10001",
"iconUrl": "https://your-site.atlassian.net/images/icons/priority_major.gif",
"name": "P2",
"id": "10001"
}
],
"defaultValue": {
"self": "https://your-site.atlassian.net/rest/api/2/priority/4",
"iconUrl": "https://your-site.atlassian.net/images/icons/priorities/low.svg",
"name": "Low",
"id": "4"
}
},
Jakub Zimny December 19, 2022

Hello, thank you for the answer. We use the expand switch, it returns defaultValue for many fields, but it does not return defaultValue for, for example, Paragraph Field (which supports rich text). Do you know if this is intended behavior?

Suggest an answer

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

Atlassian Community Events