Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,490
Community Members
 
Community Events
176
Community Groups

Why fetching custom field default values required Administer Jira permission?

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 Dec 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"
}
},

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

Atlassian Community Events