How to pass List collector multiple values from SNOW to JIRA

Koyel Guha
Tera Contributor

Hi,

Need help to pass multiple values from SNOW to JIRA. We are using record producer and we have list collector variable with the choices defined in the question_choice table. In the flow designer, I have done a look up in the question_choice table with condition "sys id is one of getcatalogvariable.variable_name" and also tried with a flow variable by taking For Each question choice value. Also tried with a script 

 

var arr = fd_data._1__get_catalog_variables.variable_name;
var member=  JSON.stringify(arr);
return member.slice(1,-1);
 
But nothing is working. Either its taking an output with combining the two values in single word or its taking sys id. 

 

I am getting this type of error : 

{
    "Action Status": {
        "code": 1,
        "message": "Error:  Option value ' Turbo' is not valid (Process Automation.3c5dd02e77f11110cc985228c81061d5; line 4)"
    }
}

 

Can somebody please help me to achieve this requirement ? 

 

Thanks in advance.

 

 

 

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Koyel Guha 

how does JIRA expect the value?

use this to get display value

var users = '' + fd_data._1__get_catalog_variables.variable_name.getDisplayValue(); // convert to string
 
return users.toString();

OR

If the above doesn't work then use this

var users = '' + fd_data._1__get_catalog_variables.variable_name.toString();

var arr = [];
var gr = new GlideRecord("question_choice");
gr.addQuery("sys_id", "IN" , users);
gr.query();
while (gr.next()) {
   arr.push(gr.getValue('text'));
}
return arr.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Thanks Ankur. The above solution worked fine.