It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to get customer request type?

I need to do something based on the "Customer Request Type". For example, following code is I put, but doesn't get the value. 

Please let me if you know the answer. Thanks lot!

def customerRequestCf = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
customerRequestCf.getCustomFieldType().getSingularObjectFromString("Customer Request Type")
def customerReq = issue.getCustomFieldValue(customerRequestCf) as String

if (customerReq != "S&OP" || customerReq != "Data" || customerReq != "Security" )

{  .....    }

2 answers

I need to get know if the user clicks following Customer Request Type in JIRA Service Desk => "S&OP", or "Data", or "Security" , then do something. But how can I tell?

Please help!!!

 

 

 

 

 

At the user interface , when user gives the informations in a request type, the request is created. 

In your jira workflow

1-go to the exact project

2- open the workflow

3- click edit. 

4- Go to the first transition for create request 

5- Click on it.

6- On the opened diaolog box choose the post funtions

7- choose Script Post-Function [ScriptRunner]

8- Choose the right one for your problem.

9- paste your script there

choose the other functionalities for your aim.

 

In Script Post-Function [ScriptRunner] there are many selections. One of them can solve your problem I think.

 

you can use transition post functions in your project workflow. 

Scriptrunner post functions are suitable for your question. 

Paste your code there and choose what to do your system. 

Like : 

This is your condition; -->

def customerRequestCf = customFieldManager.getCustomFieldObjectByName("Customer Request Type")
customerRequestCf.getCustomFieldType().getSingularObjectFromString("Customer Request Type")
def customerReq = issue.getCustomFieldValue(customerRequestCf) as String

if (customerReq != "S&OP" || customerReq != "Data" || customerReq != "Security" )

{return true;}

else{return false;}

This is what you want your system do: -->

send e-mail,

change the status of current issue, ..... vs.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

935 views 8 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you