How can we get the value of the custom fields?

Shijianmin
Kilo Contributor

We used Jira spoke v2.5 to integrate ServiceNow SAFe with Jira software.

We have one problem that couldn't get the value of the custom field in Process Jira Webhooks of Subflow.

How can we get the value of the custom fields?

 

[Prerequisite settings]

  • 1.Create a project in Jira software and add customization fields(JiraID) to this project
  • 2.Use "Flow >trigger jira" to pass data from ServiceNow SAFe to Jira Software
  • 3.Use "Subflows > Process Jira Webhooks" to pass data From Jira Software to ServiceNow SAFe

Detail of setting

  • 2.Use "Flows >trigger jira" to pass data from ServiceNow SAFe to Jira Software,

            The setting as follows:

           find_real_file.png

 

  • 3.Use "Subflows > Process Jira Webhooks" to pass data From Jira Software to ServiceNow SAFe

           The setting as follows:

           find_real_file.png

          

[Test After setting]

  • Create a story in the ServiceNow 

         find_real_file.png

  • The Same story is Automatically generated in Jira software find_real_file.png

 

[About log as follows]

  • The log of Flow > Trigger jira >actionfind_real_file.png
  • The log of Subflows > Process Jira Webhooks >actionfind_real_file.png

 

18 REPLIES 18

Kiran Raddy
Tera Expert

Hi,

 

Please find the below details to parse Subflow payload and populate JIRA custom field value to any specific table field.

 

1. Create Action -> Create a new action, then first step is to create an input variable.

Create a payload input variable with type String (Full UTF - 8)(matching sub flow payload data type with custom action input payload data type).

 

KiranRaddy_0-1704900956093.png

2. Second step is to add a new step and select Script step that executes custom JavaScript. We can also use JSON Parser step to parse the payload data but, it requires some specific Integration Hub plugins installed in order to enabling this step.

 

KiranRaddy_3-1704905780426.png

 

 

 

(function execute(inputs, outputs) {

    var parsePayload = JSON.parse(inputs.payload);
    gs.info("payLoad is "+parsePayload);
    outputs.customfieldvalue = parsePayload.issue.fields.customfield_10103;
    gs.info("output string "+outputs.customFieldValue);
    
})(inputs, outputs);

 

 

 

 

 

outputs.<variable_name> must match output variable section name.

 

KiranRaddy_1-1704904921028.png

 

3. Last step is to create Action Output that contains the final result and can be re-used in Subflows and flows.

 

KiranRaddy_2-1704905180995.png

After creating output variable, exit edit mode and drag-drop output variable from previous script step.

 

KiranRaddy_2-1735811893689.png

Publish and call this action in your flow or a Subflow provide a payload as an input then the result will be stored in the output variable. Then, use the auto-populated data section output variable to map to your required table field. Please find in below screenshots.

 

 

KiranRaddy_2-1735809376356.png

 

KiranRaddy_3-1735810931465.png

 

 

hope this helps !

Mark my answer correct/helpful based on impact .

bekfro
Kilo Sage

@Kiran Raddy 

Hi Kiran - I'm trying to get the fixVersions name from the Jira Issue. 

 

 

I have followed the steps you have provided, can you give more details on how to finish the last step?

 

Publish and call this in your flow or a Subflow provide a payload as an input then the result will be stored in the output variable. Then, use the auto-populated data section output variable to map to your required table field.

 

Thank you!

@bekfro,

 

Yes. That's correct.

Can you provide screenshots of how you called this in your subflow?

I am trying to get the Jira End Date added to the webhook to get updated info when the end date changes. 

bekfro
Kilo Sage

@Kiran Raddy 

I'm sorry, do you have any screenshots to help me with the last step to call the action in the process webhook subflow?

My goal is to get the Fix Versions from the Jira issue to populate in a new field I have created on the task table.

 

I have followed your steps to create the action, but I'm not getting the new action to work properly in the subflow.