Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JEC - How to use issue data as a parameter?

Iker Gómez Eiras April 30, 2024

So I've been trying to tinker with running scripts through JEC, but I can't find anything at all about how to use JIRA data as a parameter for my scripts.

Yes, I can send the data to JEC as a key-value pair.

But how in the name of $deity do I use those key-value pairs in JEC to forward them as parameters to my script? I know it's something in "args", but I've no idea what the correct "grammar" is, and as usual, the example provided by Atlassian is lackluster.

The video Atlassian provided explaining this feature (in What's New in Jira Service Management - April 2024 (atlassian.com)) also comes short, showing how I can set up the key-value pair, but not how to configure my JEC JSONs to use those values.

Has anyone managed to get this working, and could shed some light on this?
Thanks in advance for your time.

2 answers

1 accepted

1 vote
Answer accepted
Gabriell Valentine May 10, 2024

Ok @Iker Gómez Eiras After reaching out to helpdesk and tinkering around I've made progress. I created a powershell script that outputs $args to a text file and found that I got four arguments. 

-payload
{"actionType":"custom","activationId":"XXXXXXXX-XXXX-XXXXX-XXXX-XXXXXXXXXXXX","action":"SimpleNotifyTeams","requestId":"XXXXXXXXX-XXXXX-XXXXX-XXXX-XXXXXXXXXXXXX","sendCallbackToStreamHub":false,"args":"Args String","Message":"Message String","List":["List Value 1","List Value 2"]}
-apiKey
XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXX
-jsmUrl
https://api.atlassian.com
-logLevel
DEBUG

In my case I would have to take that -payload param, convert from JSON and THEN I could get to the three key pairs I actually passed to the script (args, Message, and List). Powershell is the only language I know well, So I'm sot sure how this would work in Python or what have you, but there you go. If there was ANYTHING in the documentation to suggest this was how this would work I did not see it either.

Iker Gómez Eiras May 13, 2024

@Gabriell Valentine Honestly, I kinda gave up on this -- moved on to other tasks, decided to wait until either the community or Atlassian properly documented it. Or my company decided to use other tools.

Just tried and yep, had to add a "$payload" param to my script (I also use powershell) which provides the whole thing. Thanks!

0 votes
Gabriell Valentine May 6, 2024

I'm really happy to know I'm not the only one struggling with this. It would be really helpful is there were somewhere I could send the incoming JSON so I could figure out what is actually being sent when I pass along those key pairs. The documentation is pretty confusing and there doesn't seem to be any other online resources for figuring this out. I'll keep testing and If I find anything I'll let you know @Iker Gómez Eiras

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events