import com.atlassian.jira.component.ComponentAccessor
import java.sql.Timestamp
if (issue.getIssueType().getId() == "193") {
if (issue.getWorkflowId == "<to check the workflow step id... what to insert here? and where to get it?>") {
issue.setDueDate(new Timestamp((issue.dueDate + 3).time)) // set due date
}
if (issue.getWorkflowId == "<to check the workflow step id... what to insert here? and where to get it?>") {
issue.setDueDate(new Timestamp((issue.dueDate + 7).time)) // set due date
}
}
This groovy script will check for conditions by the workflow step id. How can I do so? Can anyone show me the code? Urgent. Need help ASAP. Thanks in advance.
That's going to be hard work if I remember the API correctly.
Why don't you just use two scripts, one on each post-function?
I thought of making it all in one script because I might need to add more codes for different days for each workflow steps.
If there's like 10 set of different days, that would be 10 scripts.
Which one is the best solution for this matter? If the one with conditions is the best, if you don't mind show me a sample of the code.
What would you suggest, Sir?
Thank you.
Cam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, if you use the id's, you'll need some (potentially unpleasant) code to find them.
I'd take a different route. If you wrote 10 scripts and saved them as files in the scripts directory, you could use them repeatedly without thinking about transtion ids. You'd say "use script add-4-days for this transition" and for the next one "use script add-6-days", and for a third, reuse add-4-days. It'll keep your scripts very short and simple.
Another option is a bit longer - you could use a single script that reads a transition property that you add to transitions, which is a lot easier to get to in a post-function than the id. Also means one script keeps it really simple!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sir,
Oh, I see. And if I may ask, could you provide and show me the code for it?
As I'm not really familiar with it.
I appreciate if you could lend me a hand.
Thank you.
Cam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.