I have created a custom script post-function to update the system field, Due Date and it's the first function in the list of post functions and yet it does not update the date.
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import java.sql.Timestamp
MutableIssue getIssue = issue;
def reporter = issue.getReporterId();
if (reporter == 'abc@xyz.com') {
getIssue.setDueDate(new Timestamp((new Date() + 30).time));
}
Could anyone let me know what I'm doing wrong here?
Hi @Kiran_Kumar,
You can try below script by validating username, it did work for me
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import java.sql.Timestamp
if(issue.getReporter().name == "username-in-jira") {
issue.setDueDate(new Timestamp((new Date() + 30).time));
}
@Leo The script I have written works without any errors but the due date is not updated to the new date.
Anyways, I have tried your way as well, it does not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kiran_Kumar,
You mean, Due date itself is not getting updated from EMPTY? or it still holds the old value?
If you are not seeing Due Date in issue page, then would suggest you to check the field availability in View screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.