# Jira Status mapping

**URL:** <https://community.exalate.com/t/jira-status-mapping/5144>\
**Category:** General Questions\
**Tags:** onpremise-jira, jira-cloud, jira, migrated\_question\
**Created:** [November 4, 2024, 7:46am UTC](https://community.exalate.com/t/jira-status-mapping/5144 "2024-11-04T07:46:13Z")\
**Posts on this page:** 4\
**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, 7:46am UTC](https://community.exalate.com/t/jira-status-mapping/5144/1 "2024-11-04T07:46:13Z")

</div>

_Originally asked by Ori Arbel on 30 March 2022 [(original question)](https://oldcommunity.exalate.com/questions/42835873)_

* * *

i am running a status sync mapping which looks like this,

if(replica.project.key == “SUP”){  
issue.projectKey = “IPS”  
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: “Support Case”  
// [“remote status name”: “local status name”]  
def statusMap = [  
“Open”: “Pending Support”,  
“In Progress”: “Pending Support”,  
“Pending Plugin”: “Pending Support”,  
“Pending R&D”: “Pending Support”,  
“Pending PS”: “Pending Support”,  
“Pending MA”: “Pending Support”,  
“Pending Research”: “Pending Support”,  
“Pending other” : “Pending Support”,  
“Pending QA” : “Pending Support”,  
“Back From Pending” : “Pending Support”,  
“Team Leader Review”: “Pending Support”,  
“Done”: “Back From Support”,  
“Rejected”: “Back From Support”  
]  
def remoteStatusName = [replica.status.name](http://replica.status.name/)  
issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)  
}

but the issue i am having is every time we sync anything between the tickets, the ststus mapping kicks in and changes the status on the other side even when i dont want it to

(lets say i only wanted to sync the Jira comments right now)

is there a way to map in such a way that only in certain statuses the status mapping kicks in, and in other situations not ?

right now this sync issue is creating a problems from the team

after the initial sync when the each ticket has a life cycle and workflow it goes through that is not always relevant for the other side,

but when i add a comment it sync the status again also in accordance to the mapping, which is at this point not relevant anymore

i hope that makes sense

* * *

---

<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, 7:46am UTC](https://community.exalate.com/t/jira-status-mapping/5144/2 "2024-11-04T07:46:15Z")

</div>

_Answer by Jorden Van Bogaert on 31 March 2022_

Hi Ori Arbel

You can simply create an if statement like this

```auto
if(!(replica.status.name == "To Do" || replica.status.name == "Open"))
{
	////Do status mapping + set status
}

```

Here you basically say, if the replica status is “To Do” or “Open”, then you don’t want to run the status mapping. But if they aren’t (notice the ! at the beginning), then I want to run the status code.

Hope it helps

Kind regards

Jorden

* * *

---

<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, 7:46am UTC](https://community.exalate.com/t/jira-status-mapping/5144/3 "2024-11-04T07:46:16Z")

</div>

_Answer by Ori Arbel on 31 March 2022_

Hi Jorden,

worked like a charm

thanks for the tip

* * *

#### Comments:

> **Jorden Van Bogaert commented on 31 March 2022**
>
> > Hi Ori Arbel
> 
> Awesome! Could you perhaps mark my answer as accepted?
> 
> That’ll help the community to know this is resolved and will allow other users to find this question easier.
> 
> Have a great day!
> 
> Kind regards
> 
> Jorden

---

<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, 7:46am UTC](https://community.exalate.com/t/jira-status-mapping/5144/4 "2024-11-06T07:46:21Z")

</div>

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