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
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?
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.