• Community
  • Products
  • Jira Software
  • 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

gary qiu February 20, 2014

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

0 votes
gary qiu February 20, 2014

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")

0 votes
gary qiu February 20, 2014

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

Suggest an answer

Log in or Sign up to answer