ScriptRunner Behaviours not working with customer

Nour BenAmor July 14, 2020

 

Hello,

I wish set automatically the  approvers based on another customfield (DropDown List)

I put the following script in the Behavior:

when i test as a jira agent from the portal , the script works correctly and the user is setted in the approver field

But when i test as a customer from the portal , nothing happen and the approver field is still empty.

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField


@BaseScript FieldBehaviours fieldBehaviours

def customefield = getFieldById(getFieldChanged())
def Approvers = getFieldByName("Approvers")

Approvers.setFormValue(null)


switch (customefield.getValue()) {
case "A":
Approvers.setFormValue(["user1"])
break
case "B":
Approvers.setFormValue(["user2"])
break

}

 

Please Help

1 answer

0 votes
brbojorque
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 14, 2020

Hi @Nour BenAmor

The customers in the instance does not have a browse permission to the project and therefore they won't have access to the user list or even @ mention users.

You have to find another way like creating your own dropdown but with multi-select list and process that internally.

Refer to this answer.

https://community.atlassian.com/t5/Jira-Questions/mention-non-agent-users-in-Service-Desk/qaq-p/46044

Nour BenAmor July 14, 2020

Thank you for the quick reply

But I already give the customer the permission to search in the projectcustomer permission.png

Did i misunderstood something ?

Nour BenAmor July 14, 2020

 

@brbojorque  And as a customer , he can search for users.

So if he can add/ browse users in the approvers field from his side , i can from my side set the list of approvers i need.

approvers.png

Suggest an answer

Log in or Sign up to answer