Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Version Released > Lookup Issues > Custom Web Request

Michael Caplan November 26, 2023

Hi there,

Using Jira automation, I'm trying to create a site wide rule that would POST a JSON request down to a web server containing all the issues in the version that was released.  

My rule looks like this:

1. When: Version released

2. Then: Lookup issues:  fixVersion = '{{version.name}}'

3. And: Send web request: POST Custom Data: {{lookupIssues}} 

 

When reading the body of the POST on my recipient server, I get nothing.  I'm wondering if:

* Either my step 2 is not right (the audit log is showing associated lookup items

* Or my step 3 is not properly setting a custom data body.

* Or I am not accessing the JSON body correctly server side (pretty sure this is not the case)

 

I'm thinking the latter.  How do I get the lookupIssues to POST as a JSON string? 

 

I also tried {{lookupIssues.asJsonString}}  with no luck

 

Thanks,

 

Mike

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 26, 2023

Hi @Michael Caplan 

There could be several causes for what you describe.  I recommend adding writes to the audit log as the rule proceeds to check them.  And you can try these diagnosis steps.

  • You note your rule is "site wide".  By that do you mean the rule is global in scope, and if so have you determined that the version name's are unique across the site's projects?
  • Does the version which was released have any issues assigned?  You can check that with an advanced compare condition before the rule proceeds:
    • first value: {{lookupIssues.size|0}}
    • condition: greater than
    • second value: 0
  • Your rule is putting only the smart value {{lookupIssues}} in the custom data
    • That will only return a comma-separated values (CSV) list of the keys of the issues.  Is that what your service is expecting?
    • What format is your service expecting for the custom data?
  • What is the request status after the Send Web Request action?  I recommend logging that to see if the call was successful.

Kind regards,
Bill

Michael Caplan November 26, 2023

Ah!  Thanks Bill.

 

Learned allot with your post.  I was indeed hoping to POST all available data for each issue.  Not just a CSV list of keys.

The debugging utilities (new to me, thanks) really helped out.  Ended up taking a very different approach:

Screenshot from 2023-11-26 21-01-10.png

 

Not the consolidated JSON array of issues in a single POST, but will work just fine for what I'm after.  

 

Thanks!

 

Mike

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events