• Community
  • Products
  • Jira
  • Questions
  • Behaviours Plugin:Making a issue auto assign to a specify user depending on a customer field choosing a specify value entered in to the form by script

Behaviours Plugin:Making a issue auto assign to a specify user depending on a customer field choosing a specify value entered in to the form by script

Behaviours Plugin:Making a issue auto assign to a specify user depending on a customer field choosing a specify value entered in to the form by script

this is my script:

log.debug("--------------------This is to test Behaviours Logging----------------")
FormField formClient = getFieldByName("client")
FormField formassign = getFieldByName("assignee")

log.debug("----------------> " + formClient.getValue())

if (formClient.getValue()=="linux") {

formassign.setFormValue("hyqiu")
//log.debug("*********************** 2 > " + summary.getFormValue())
}
else {
formassign.setFormValue("exu")
}

I have got the value "liunux", but the logfile reports

/rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Returning map: [null:[setValue:hyqiu]]

and the issue does not be assigned to project leader.

could you help me on this ?

my jira is 5.4.1

thanks

Gary

2 answers

and I found the log report"

2014-02-21 01:57:07,142 http-8443-5 ERROR hyqiu 117x2905x1 ec4258 192.168.241.118 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json
[onresolve.jira.groovy.BehaviourManagerImpl] Found class but could not find method run

now it is ok.

FormField formClient = getFieldByName("client")
FormField formassign = getFieldByName("assignee")
FormField assigneeField = getFieldById("assignee")

//log.debug("----------------> " + formClient.getValue())

if (formClient.getValue()=="linux") {

log.debug("----------------> " + formClient.getValue())
//formassign.setFormValue("hyqiu")
assigneeField.setFormValue("hyqiu")
//log.debug("*********************** 2 > " + summary.getFormValue())
}
else {
formassign.setFormValue("hyqiu")
}

the difference is:

FormField assigneeField = getFieldById("assignee")

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 ...

3,232 views 14 19
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