Hi, just wondering what is wrong in my code
<!-- @@Formula: if (issue.issueTypeObject.name == "Specials"){ if (issue.get("resolutiondate") == null || issue.get("customfield_10007")==null){ return null; } else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24) <1){ return 0; } else { return (issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24) } } else { if (issue.get("resolutiondate") == null || issue.get("customfield_10002")==null){ return null; } else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24) <1){ return 0; } else { return (issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24); } } -->
Community moderators have prevented the ability to post new answers.
Fixed, the problem was with the calling of issue type..
Correct way to call issue type (which wasnt working before as my if statements wernt properly structured) (capital I in IF and E for else.)
issue.get("issuetype") == "Custom Issue Name"
You're also missing a semicolon at the end of one of the return statements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
really? i dont see any im missing.. but i also tried this and this didnt work either... <!-- @@Formula: if (issue.issueTypeObject.name == "Specials") { if (issue.get("resolutiondate") == null || issue.get("customfield_10007")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24) <1) return 0; else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10007").getTime()) / (1000*60*60*24); } else { if (issue.get("resolutiondate") == null || issue.get("customfield_10002")==null) return null; else if ((issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24) <1) return 0; else return (issue.get("resolutiondate").getTime() - issue.get("customfield_10002").getTime()) / (1000*60*60*24); } -->
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have even tried putting them in functions and calling the functions, but that did not work either.. the only thing i can possibly think of is that issue.issuetypeobject.name is wrong, i am using latest jira perhaps this has been updated since 2011?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you look in atlassian-jira.log for errors?
I see at least one problem: you have several "Else" statements (with an uppercase E).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wasn't aware the code was case sensitive! also i dont think im able to check the log as our instance is hosted externally and i dont have access to that server just jira admin. tried using lower case elses and ifs' still no luck.. cant understand what im doing wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.