I'm looking for to add some random numbers to a jira custom field ("Actual time") by below groovy script as part of workflow transition. Everything works fine but couldn't remove the decimal part from below number, ie, here I need the custom field value as "1". Please suggest how its possible?
def time = 1.5166666667 IssueManager issueManager = ComponentAccessor.getIssueManager(); CustomFieldManager cfm=ComponentAccessor.getCustomFieldManager(); def MeD =cfm.getCustomFieldObjectByName("Actual time"); issue.setCustomFieldValue(MeD, String.valueOf(time));
Also, currently the custom field "time" is free text field. Which all changes needs to be done in code level for changing the field type to number field. Now getting below error,
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs