• 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

This widget could not be displayed.

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

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

578 views 25 15
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