How can I set a fixed component value in Jira's incoming script?

Originally asked by Robert Horan on 15 November 2021 (original question)


I would like to set up a ServiceNow to Jira connection and use the incoming script to set the value for each Jira issue, and I’d like it to be a static/fixed value. I looked in the documentation and could not find a reference that told me how to do this. Any help would be appreciated.


Answer by Robert Horan on 16 November 2021

Hi Dmitrij,

Thanks - that’s not quite what I meant.

Let’s go with a simple case. Let’s assume Components is a required field in Jira, so therefore I need to have SOME value added when ServiceNow sends its data over and a Jira issue is created.

So let’s say I create a component called SNOW and I want every ServiceNow ticket to sync to Jira and for the Jira issue to have a SNOW value in Components.

Do add a line in the ServiceNow outgoing script to send a component value, or do I add something to the Jira incoming script to always add a value?


Answer by Dmitrij POPOV on 16 November 2021

Hello Robert Horan ,

To set up a Component value to Jira issue, that value has to be set up in the list of Components of Jira project your are targeting your synchronisation to. That means, if every single Jira issue has it’s own Component value - it has to exist in your project already.

From the other hand, you may use Jira Custom Field, that would be present on Create and View screens (not Edit). This way you will be able to set it up the way you like. And, even, you would be able to map it to a ServiceNow field to transfer the value that you want to store on Jira’s side. (And vice-versa, if needed).

With best regards,
Dmitrij

Configuring Custom field in Jira Cloud

Configure custom field context in Jira Cloud