# How to sync 2 different statuses in one based on transitions

**URL:** <https://community.exalate.com/t/how-to-sync-2-different-statuses-in-one-based-on-transitions/4331>\
**Category:** General Questions\
**Tags:** exalate, status, migrated\_question\
**Created:** [November 4, 2024, 6:48am UTC](https://community.exalate.com/t/how-to-sync-2-different-statuses-in-one-based-on-transitions/4331 "2024-11-04T06:48:44Z")\
**Posts on this page:** 2\
**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, 6:48am UTC](https://community.exalate.com/t/how-to-sync-2-different-statuses-in-one-based-on-transitions/4331/1 "2024-11-04T06:48:44Z")

</div>

_Originally asked by Arto Kovalainen on 31 August 2020 [(original question)](https://oldcommunity.exalate.com/questions/11341967)_

* * *

I have Server JIRA with following workflow:

 ![](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/953ca1ea06599966e51397bc4c10a69bcdb3616b.png)

And connected Cloud JIRA with following:

 ![](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/3f64955a688df95be8aba24964d02041039d468c.png)

How to achieve:

- If status transitioned in Server from Open to In progress
  - Then Map status In progress to Investigation in Cloud JIRA

- If any other transition to In progress in Server (eg. from Done to In progress or from Pending to In progress (transition is missing in the picture but don’t mind that)
  - Then Map status In progress to Selected for Develepment in JIRA cloud

?

Optionally

- If status transitioned in Server from Open to In progress
  - Do nothing in JIRA Cloud workflow

- If any other transition to In progress in Server (eg. from Done to In progress or from Pending to In progress (transition is missing in the picture but don’t mind that)
  - Then Map status In progress to Selected for Develepment in JIRA cloud

?

* * *

---

<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, 6:48am UTC](https://community.exalate.com/t/how-to-sync-2-different-statuses-in-one-based-on-transitions/4331/2 "2024-11-04T06:48:45Z")

</div>

_Answer by Francis Martens (Exalate) on 04 September 2020_

Hi Arto Kovalainen

You can construct it as follows using the previous replica named as ‘ **previous** ’.  
It contains the message that was sent before the current one. If the status was sent then, you will be able to know what the originating status was.

```auto
if (replica.status.name == "In Progress") {
   issue.setStatus(previous?.status.name == "Open" ? "In Progress" : "Selected for Development")
}

```

Note that the previous replica is not set when exalating an issue, so you will have to use the [safe navigation operator](https://groovy-lang.org/operators.html#_safe_navigation_operator) after previous, or distinguish using the firstSync boolean.

* * *
