how to validate DueDate required on Assign Screen using Groovy Runner 's Script Validator ?

my jira version 4.4.1.

Groovy Runner plugin version is 2.0.7

1 DueDate (system field) is on Assign Screen

2 i want to make DueDate field required when assign an issue. i'v known using groovy runner 's Fields Required function can easily implement it . but i want to try it using groovy

3 i try below code

ComponentManager componentManager = ComponentManager.getInstance()

// DueDate is set or not
IssueManager issueManager=componentManager.getIssueManager()
MutableIssue missue=issueManager.getIssueObject(issue.getId())
missue.getDueDate() != null

missue.getDueDate() seams get the value stored in database, not get the value displayed on Assign Screen.

for example,

issue A 's Due Date 's value is 5/Mar/13 , Open Assign screen,remove the Due Date value,click Assign,no error message display!!

issue B has not set Due Date value,Open Assign screen,set Due Date value to 6/Mar/13,click Assign,there error message display,and block assgin action !!

anyone can help ?

2 answers

1 accepted

> 1 DueDate (system field) is on Assign Screen

So this implies you're checking when doing a transition? Because you cannot use this method if you're just editing an issue.

To be honest, it doesn't make a great deal of sense to me if issue.getDueDate() retrieves the stored value, but all other methods like issue.getSummary() gets the attribute value that the user has just edited.

hi Jamie,

issue.getDueDate() works,it also gets the attribute value that the user has just edited.

2 votes
Henning Tietgens Community Champion Mar 04, 2013

You can take a look at the request like this

request = webwork.action.ActionContext.getRequest()
duedate = request?.getParameter('duedate')

There you get the value entered in the transition screen. I don't know if "duedate" is the right spelling for the parameter, it's only a guess.

Henning

I don't think you can put any fields on the system assign screen... so he must have a workflow action called Assign...

Henning Tietgens Community Champion Mar 04, 2013

Aaaahh... is it the system assign screen you're talking about? Then this doesn't work, i though you're talking about a transition screen...

yes ,the Assign Screen is the transition screen

Henning Tietgens Community Champion Mar 04, 2013

Mmh, yes, that's right.

IIRC Henning's method is the only way to get links updated in this transition, for everything else use the proper API.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,815 views 11 18
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot