how to get customer request type?

ANN LEE November 8, 2016

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

0 votes
Şükrü TURGUT October 23, 2019

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.

0 votes
ANN LEE November 8, 2016

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!!!

 

 

 

 

 

Şükrü TURGUT October 23, 2019

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.

 

Suggest an answer

Log in or Sign up to answer