I’m trying to compare the RST hours of an issue in a if statement but can’t understand how to get the hours:
issue.fields.customfield_13227 = “0h 0m”
_.values(issue.fields.customfield_13227).getHour() = 0
Both won’t work and I couldn’t understand the object returned in _.values(issue.fields.customfield_13227).
It seems to have many objects inside the main object (21, ‘RST - Response Time’, Object:object, Object:object, Object:object, Object:object).
Btw, is there a way to print the structure of an object using underscore.js? Even the _.get function isn’t recognized by EazyBI import.
You may want to transform the custom field value to date first with
new Date(Date.parse(issue.fields.customfield_13227)). You can see such an example for retrieving the hours of issue creation from the creation date here - Generate count of issues created per day and per hour.
Roberts // email@example.com
Hey @roberts.cacus ,
Thank you for the help, I wasn’t tranforming it to Date and it was the issue.
It’s working fine now