With or without JQL. is it possible to get some result that lists all the assignees for a given srpint.
Something like this
{
"projectName": "something",
"dateCreated": "2019-01-24T15:43:44.000-0600",
"summary": "Verify business is OK with update",
"description": "This has been rolled out into production",
"assignee": ["john doe", "Maz Doe"], // I need this to be an array
"status": "Done",
"statusColor": "label-success",
"estimated": 0,
"remaining": 0,
"logged": 0,
"estimateTimeDifference": 0,
"hasEstimateChanged": false,
"labels": "",
"components": "something something",
"epic": null
}
Using the changelog parameter to the issues JQL endpoint and with this logic, I got all the assignees for a given issue.
public listIssueAssignees(issue: Issue): string {
const histories = issue.changelog ? issue.changelog.histories : [];
const assignees: string[] = [];
if (histories) {
histories.forEach((history: any) => {
history.items.forEach(
(item: { field: string; fromString: string; toString: string }) => {
if (item.field === 'assignee') {
assignees.push(item.fromString);
assignees.push(item.toString);
}
},
this
);
}, this);
}
return [...new Set(assignees)].filter(v => v != null).join(', ');
}
Hello @Maz_Mahari
Welcome to the community.
A Jira issue can have only one Assignee at a time. Are you trying to extract the history to find out if the Assignee has been changed such that different people were assigned to the issue at different times?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that's right. I'd love to be able to view a history of past assignees for a given issues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you looked at the Jira REST API? The endpoint for getting an issue can return the issue history if you use the expand parameter. You would have to parse through the output to get the entries concerning Assignee, and build your own output array.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean pair expand with changelog. Because that wouldn't work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is what I meant. I did not actually test it. I suggested it based on the documentation.
It what way does it not work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.