# Trigger New Ticket based on CF value

**URL:** <https://community.exalate.com/t/trigger-new-ticket-based-on-cf-value/5468>\
**Category:** General Questions\
**Tags:** onpremise-jira, exalate, usecase, cloud-jira, migrated\_question\
**Created:** [November 4, 2024, 8:06am UTC](https://community.exalate.com/t/trigger-new-ticket-based-on-cf-value/5468 "2024-11-04T08:06:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:06am UTC](https://community.exalate.com/t/trigger-new-ticket-based-on-cf-value/5468/1 "2024-11-04T08:06:37Z")

</div>

_Originally asked by M. Ashar Iqbal on 17 April 2023 [(original question)](https://oldcommunity.exalate.com/questions/58501097)_

* * *

There is a custom field called ‘Supplier’ at Jira OnPrem side.

There are two Projects at jcloud side.

Ticket is always created and exalated from Jira OnPrem side.

If the Custom field value 01 is selected, then it should exalate a ticket for Project A

If the Custom field value 02 is selected, then it should exalate a ticket for Project B

Do not prefer to create more than one connection to comply with this use-case.

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:06am UTC](https://community.exalate.com/t/trigger-new-ticket-based-on-cf-value/5468/2 "2024-11-04T08:06:38Z")

</div>

_Answer by Charlie Schonken on 17 April 2023_

provided you set a replica for ‘Supplier’ in the Jira OnPrem output script (example **replica.supplier** ), you can in scripting for jcloud in the incoming script do an IF statement to specify the project key it must be created for.

```auto
if(replica.supplier?.value == '01') {
  // Exalate to Project A
  issue.projectKey = 'PROJECTA';
} else if(replica.supplier?.value == '02') {
  // Exalate to Project B
  issue.projectKey = 'PROJECTB';
}

```

There may be better ways, but that is how I currently do it.

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:07am UTC](https://community.exalate.com/t/trigger-new-ticket-based-on-cf-value/5468/3 "2024-11-06T08:07:24Z")

</div>

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