Hi
From issue history I need to get the first user to whom the issue was assigned.
Expected result as in the screenshot
Thank you)
Hi
From issue history I need to get the first user to whom the issue was assigned.
Expected result as in the screenshot
Thank you)
Hi,
There are two ways how to calculate the first assignee:
code:
CASE WHEN
[Issue].CurrentHierarchyMember.Level.Name = "Issue"
THEN
[Assignee].[User].GetMemberbykey(
Order(
Filter(
Descendants([Assignee].CurrentHierarchyMember,[Assignee].[User]),
[Assignee].CurrentMember.Name <> "(unassigned)"
AND
(
[Transition field].[Assignee],
[Measures].[Transitions from],
[Time].CurrentHierarchy.DefaultMember
)>0
),
([Measures].[Transition to first timestamp],[Transition Field].[Assignee]),
BASC
).item(0).key
).Name
END
This approach would calculate the first assignee for an issue.
code:
[jira.customfield_firstassignee]
name = "First assignee"
data_type = "string"
javascript_code = '''
var assignee_dname;
if (issue.changelog && issue.changelog.histories && issue.changelog.histories.length > 0) {
var histories = issue.changelog.histories;
for (var i = 0; i < histories.length; i++) {
var history = histories[i];
if (history.items && history.items.length > 0) {
for (var n = 0; n < history.items.length; n++) {
var item = history.items[n];
if (item.field == 'assignee' && item.toString) {
assignee_dname = item.toString;
}
}
}
if(assignee_dname){
break;
}
}
}
issue.fields.customfield_firstassignee = assignee_dname;
'''
In some specific scenarios (assignee is set during creation) both approaches may return different results for an issue.
Martins / eazyBI support
Hi Martins,
I tried to use the same but can this be used to get the first Date set for the Due Date field rather than the current date
@gsunil.kumar
when using eazyBI for Jira Server or Datecanter, eazyBI won’t import the history for Due date field.
You can try a similar script (as above) for some of your own custom fields.
I believe this community post could be useful to find the initial date value:
Martins / eazyBI
Thanks Martins.
It helped.
Regards,
Sunil