Forums

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

get Value of a Customfiled Using json Format

Abdulrahman Aldakak March 18, 2020

Hello guys,
we are facing a problem in our plugin.
we have recently devolved a plugin but unfortunately it doesn't work well.
what the plugin does that it creates a postfunction, which creates one or more subtasks using json format and it works but sometimes  we want to get the value of a customField and but it in the summary of the subtask but it doesn't shows the value  rather it shows

like this :

Subtask 1: $cf.customField:('customfield_10200')

JSON format that it used to create Subtasks

 

[

{

"id": 1,

"summary": "Subtask 1: $cf.customField('customfield_10200')",

"description": "Description 1",

"assignee": "admin",

"links": []

}
]

1 answer

0 votes
mfabris
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.
March 19, 2020

what about

 

function getCustomField() {
var key = this.JIRA.Issue.getIssueKey();
var yourCustomField;
AJS.$.ajax({
url: "/rest/api/2/issue/" + key,
type: 'get',
dataType: 'json',
async: false,
success: function(data) {
yourCustomField = data.fields.customfield_12345;
}
});

return yourCustomField;
};

getCustomField();

Suggest an answer

Log in or Sign up to answer