I am creating a very waterfall-ish workflow. I know what happens at every step of the way and how long (roughly) it's going to take.
I need to create 3 issues at a certain point of the workflow (clone issue and link) and set different (hardcoded) original estimates for each of them.
What I'm thinking is something along the lines of:
issue.setOriginalEstimate(10d)
issue.OriginalEstimate = 10d
I feel this shouldn't be incredibly difficult but for some reason I can't manage it and I can't find any similar topic in the tome of google.
You're close, but there's a couple of things to understand about the estimate field.
First, it's a length of time, and held internally in either seconds or milliseconds (I can never remember which). So you need to feed it a simple, large number
Second, the 10d thing is done in code for the front end and it's about making a duration pretty for the users. They can write, and see, 10d for "10 days", but it's all (milli)seconds in the actual code and data.
Last, the java API can be very helpful - bookmark https://docs.atlassian.com/jira/latest/ - it's not what I'd call "good" documentation in that 99.9% of it is not explained in human terms, but it does what javadoc is supposed to - lists the calls and their input/output.
So, to answer it without you following any links, try:
issue.setEstimate ( 10 * 24 * 60 * 60 ) That assumes seconds, and a 24 hour working day though, so you might need to tweak it.
Thanks for that, it's very useful info.
One thing though, what method do I need to import for this?
As you can see, I tried importing MutableIssue but it doesn't fix the error.image2016-8-12 12:56:4.png
Where is this script running? If it's a post-function, I'm not sure you need import anything.
Yep, it's a Script Post-Function / Clones an Issue and Links.
The other imports are for a different function, I need to set a custom field as well for the issues that I clone.
It looks like you're new here. Sign in or register to get started.