# Create ticket in jira software project from JSM project based on request type selection

**URL:** <https://community.exalate.com/t/create-ticket-in-jira-software-project-from-jsm-project-based-on-request-type-selection/6146>\
**Category:** General Questions\
**Created:** [January 23, 2025, 2:13pm UTC](https://community.exalate.com/t/create-ticket-in-jira-software-project-from-jsm-project-based-on-request-type-selection/6146 "2025-01-23T14:13:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_Mayur](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/k_mayur/32/439_2.png) [@K\_Mayur](https://community.exalate.com/u/K_Mayur)\
**Post date:** [January 23, 2025, 2:13pm UTC](https://community.exalate.com/t/create-ticket-in-jira-software-project-from-jsm-project-based-on-request-type-selection/6146/1 "2025-01-23T14:13:43Z")

</div>

Hi Team,  
I have a requirement where I need to sync tickets created from JSM project to Jira software project based on Request type selection in JSM project and set the particular issue type in software project.

f (firstSync && replica.project.key == “BFGS”) {  
def customerImpact = replica.customFields.“Customer Impact”?.value?.value  
def requesttype = replica.customFields.“Request Type”?.value?.value  
def projectNameIdentifier = replica.customFields.“Project”.value.toString()  
if (projectNameIdentifier) {  
def project = nodeHelper.getProjectByName(projectNameIdentifier)  
if (project) {  
issue.projectKey = project.key  
}  
}  
if (requesttype == “Request for Customer Training”){  
issue.typeName = “Customer Training”  
}  
else if (requesttype == “Request for Onsite Support”){  
issue.typeName = “Onsite Support”  
}

I tried the above script but it says issue type not set. Let me know if there’s any other way to achieve this

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [February 14, 2025, 3:43pm UTC](https://community.exalate.com/t/create-ticket-in-jira-software-project-from-jsm-project-based-on-request-type-selection/6146/2 "2025-02-14T15:43:29Z")

</div>

After reviewing your script, I believe the issue is caused by the conditions not matching due to how the script is accessing the “Request Type” custom field.

In the structure of the “Request Type” field, the actual value you’re trying to compare—`requestTypeName`—is nested within a `value` object. The original line of code wasn’t accessing this field correctly, which caused the condition to fail and prevented the issue type from being set.

To resolve this, I recommend updating the line of script to the following:

```auto
def requesttype = replica.customFields."Request Type"?.value?.requestTypeName

```

This change ensures that the script correctly accesses the `requestTypeName` field inside the `value` object, allowing the conditions to match and the issue type to be set properly.

Please try this update and let us know if it resolves the issue. We’re happy to assist further if needed!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/system/32/3_2.png) [@system](https://community.exalate.com/u/system)\
**Post date:** [April 14, 2025, 9:14pm UTC](https://community.exalate.com/t/create-ticket-in-jira-software-project-from-jsm-project-based-on-request-type-selection/6146/3 "2025-04-14T21:14:16Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
