Hi,
I'm not a programmer, so hoping someone can help me. I'm trying to use a scripted field to take the value of our custom field "Department" and return the GL Code for it. This is what I put in. It doesn't seem to break anything, but when I try to preview it with an issue that has Department = Global, It just shows nothing. HELP.
def Department = getCustomFieldValue("Department")
def DeptCode
if (Department == "Global") {DeptCode = "1001"}
else if (Department == "Client Services") { DeptCode = "1002"}
return DeptCode
Does this issue has the Department field set ?
Alsto try first this piece of code to see what value is returned:
def Department = getCustomFieldValue("Department") return Department
What is the type of the Department custom field ? Is it text field or some other ?
Hi,
I added that in and then tried preview and this is what I got:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So then change the script as follows:
def Department = getCustomFieldValue("Department").value def DeptCode if (Department == "Global") {DeptCode = "1001"} else if (Department == "Client Services") { DeptCode = "1002"} return DeptCode
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you that worked!!
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.