# Sync literal string from DevOps to JIRA label and custom field

**URL:** <https://community.exalate.com/t/sync-literal-string-from-devops-to-jira-label-and-custom-field/5063>\
**Category:** General Questions\
**Tags:** azuredevops, jira, migrated\_question\
**Created:** [November 4, 2024, 7:41am UTC](https://community.exalate.com/t/sync-literal-string-from-devops-to-jira-label-and-custom-field/5063 "2024-11-04T07:41:17Z")\
**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, 7:41am UTC](https://community.exalate.com/t/sync-literal-string-from-devops-to-jira-label-and-custom-field/5063/1 "2024-11-04T07:41:17Z")

</div>

_Originally asked by Mark Anderson on 18 February 2022 [(original question)](https://oldcommunity.exalate.com/questions/42833051)_

* * *

Hi All

We have one was sync of Tasks from ADO to JIRA cloud

I need to set a Jira label to a constant literal string “ERP”

and the JIRA custom field “Portfolio” to the same value.

This string does not exist in the ADO, it will be hard-coded in the sync config.

My outgoing sync in ADO has these:

replica.labels = nodeHelper.getLabel(“ERP”)

replica.customFields.“Portfolio” = “ERP”

Also tried replica.labels = “ERP”

can anyone point me in the right direction

* * *

#### Comments:

> **Mark Anderson commented on 18 February 2022**
>
> > I got it working, but not sure what the custom field assignment does
> 
> issue.labels += nodeHelper.getLabel(“ERP”) – this worked
> 
> issue.customFields.“Portfolio”.value = replica.customFields.“xyz”?.value ?: “ERP” -– i believe this says if the incoming custom field contains "xyz’ use it, if not use “ERP”
> 
> There is no incoming custom field, I just want equivalent of
> 
> issue.customFields.“Portfolio”.value = “ERP”

---

<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:41am UTC](https://community.exalate.com/t/sync-literal-string-from-devops-to-jira-label-and-custom-field/5063/2 "2024-11-04T07:41:18Z")

</div>

_Answer by Francis Martens (Exalate) on 20 February 2022_

\> issue.customFields.“Portfolio”.value = replica.customFields.“xyz”?.value ?: “ERP” -– i believe this says if the incoming custom field contains "xyz’ use it, if not use “ERP”

That is correct.

\> issue.customFields.“Portfolio”.value = “ERP”

I assume it is not working?  
If not - can you check on the type of ‘Portfolio’

* * *

#### Comments:

> **Mark Anderson commented on 21 February 2022**
>
> > Thanks for reply. Porfolio is a single value select field in JIRA

> **Francis Martens (Exalate) commented on 21 February 2022**
>
> > Is ERP in the list (like without spaces) …
