- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
01-21-2021 07:23 AM - edited 01-21-2021 07:48 AM
Hello
I had an issue with an array for several tickets in jira-edit-issue and there in the field "Description".
the problem was, that I had several outputs from an other Task.
So, the array "output.color": contains:
[{"Color":"blue"},{"Color":"green"},{"Color":"red"]
Now I had three Jira-Tasks to update.
First ticket with following content in the "Description" field: blue
Secound ticket with following content in the "Description" field: green
Third ticket with following content in the "Description" field: red
Well, my Description field had ${output.color.Color}
But you know what?
Each Jira Ticket got in the Description filed this output:
["blue","green","red"]
The solution I've found was a self-made python script.
Then I created a own BYOI and this looks like:
import json
inputtable = demisto.args().get('Input-array')
my_dict=json.dumps(inputtable,indent=4)
list_json=json.loads(my_dict)
outs= (list_json["Color"])
output = {
"coloroutput": out
}
demisto.results({
'Type' : entryTypes['note'],
'Contents': output,
'ContentsFormat' : formats['json'],
'HumanReadable': output,
'ReadableContentsFormat' : formats['markdown'],
'EntryContext' : output
})
With that Script I was able to use then the field Description in jira-edit-issue with ${coloroutput} and the tickets got now the right color.
Of course, I had to add in the Integration Settings - Commands - Arguments this "Input-array".
I guess, that the problem could lay on the fact, that I had to first dumps the array and then also use loads...
regards
roger
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!