How to set customer request type base on issye type

Originally asked by Vygandas on 26 October 2020 (original question)


Hi, is there a way to set in incoming sync customer request type in Jira DC based on issue type.

I’ve looked into

https://docs.idalko.com/exalate/display/ED/How+to+synchronize+issue+type and added this for issue type mapping

def issueTypeMapping = [
// “remote issue type” : “loal issue type”
“Incident” : “Bug”,
“IT Help” : “Improvement”
]

Now i need for issue type to have one request type but for improvement to have another. Is this is possible with incoming sync or it’s recommended to use Automations with on create triggers?


Answer by Francis Martens (Exalate) on 27 October 2020

You can set the customer request type in the incoming sync.

There are a couple of examples and similar questions on this site.
Such as - customer request type sync (old community)


Comments:

Vygandas commented on 30 October 2020

Yes i’ve able to implement static value for customer request type with :
issue.customFields.“Customer Request Type”.value = “Functional issue”

however in my case Exalation connection beetween two jiras have multiple customer request type which do not match each other.
Is there a way i could make this change with such logic?:
if(issuetype = x ){

issue.customFields.“Customer Request Type”.value = “z”

}else if (issuetype = a){

issue.customFields.“Customer Request Type”.value = “y”

}

Vygandas commented on 30 October 2020

I’ve implemented by using this logic :

if (issue.typeName == "Bug")
{     issue.customFields."Request Type".value =  "Report a bug"   }
  else if (issue.typeName == "Support")
{     issue.customFields."Request Type".value =  "Support"   }