Task "jira-edit-issue" can not handle arrays in "Description"-Filed (with solution)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Task "jira-edit-issue" can not handle arrays in "Description"-Filed (with solution)

L3 Networker

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:

Spoiler

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

 

1 REPLY 1

L3 Networker

Thanks for the info

  • 2377 Views
  • 1 replies
  • 1 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!