Forums

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

I want to get the issue type i am calling jira search api to get all the issues.

Gurudayal Singh
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!
August 29, 2019

I want to get the issue type i am calling jira search api to get all the issues along with the fields summary status i am getting everything apart of issue type.

this is the field i am passing:--

issuesFieldMeta(): Array<string> {
// used to request more than one ticket
// Fields to be retrieved from JIRA
return [
this.customfields.appName,
'summary',
'reporter',
'priority',
'created',
'status',
'issuetype',
this.customfields.jwtUsername
];
}

i am getting list of all the issues along with mentioned apart of issuetype.

  the api call i am doing here......

 

getIssues(userClaims: UserClaims): Promise<Ticket[]> {
const meta = new JiraMeta();

// jira requires special chars to be encoded
const username = userClaims.preferred_username.replace('@', '\\u0040');

// select fields from project AND customfield_13100 with username
// example:
// https://jira.corp.coupons.com/jira/rest/api/2/search?jql=cf[13100]~"JPCastillo"
const jql = `project=${meta.project.key} AND cf[13100]~${username}`;

const options = {
startAt: 0,
maxResults: 1000,
fields: meta.issuesFieldMeta()
};

return this.jira.searchJira(jql, options).then(jiraResponse => {
return jiraResponse.issues.map(issue => {
issue.fields.comment = { comments: [] };
issue.fields.attachment = [];
const ticket = new JiraTicket(issue, userClaims);
return ticket.getTicketLess();
});
});
}

The same 'issuetype' field i am passing to get the detail of a perticular issue there i am getting the issuetype

fileds i am using for single issues.

issueFieldMeta(): string {
// used to request one ticket
// Fields to be retrieved from JIRA
return [
'reporter',
'status',
'priority',
'created',
'resolutiondate',
'issuetype',
'summary',
'description',
'comment',
'attachment',
this.customfields.jwtUsername,
this.customfields.appName,
this.customfields.ticketType,
this.customfields.ticketReason
].join(',');
}

api call doing here everything i am getting including issuetype.

issueFieldMeta(): string {
// used to request one ticket
// Fields to be retrieved from JIRA
return [
'reporter',
'status',
'priority',
'created',
'resolutiondate',
'issuetype',
'summary',
'description',
'comment',
'attachment',
this.customfields.jwtUsername,
this.customfields.appName,
this.customfields.ticketType,
this.customfields.ticketReason
].join(',');
}

i am first time working on jira api. i am stuck please help me out,
Thanks.

i am using.
"node": "8.9.0"
"jira-client": "^6.8.0",


0 answers

Suggest an answer

Log in or Sign up to answer