Forums

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

JMWE - Sending issues in batches using callRest function

Hugo Michelez
October 31, 2023

Hi all, 

 

I'm trying to create a post-function that posts all issues for which the status has changed to a dedicated endpoint on an hourly basis.

 

As such, I've created a Scheduled Action. 

Every hour, all issues matching the following JQL posted: project = MY_PROJECT and type in (Bug, Task, Review, Sub-task) AND status changed AFTER -1h

 

Here the post-function I have so far: 

{# Set the URL of the API endpoint #}
{% set url = "https://mycompany/endpoint" %},

{# Set the headers for the request, including the auth token #}
{% set headers = {
"Content-Type": "application/json",
"Authorization": "Token abcde"
} %}

{# Set the body of the request, using the issue data #} |
{% set body = {
"issue": issue
} %}

{# Make the POST request and store the response #}
{% set response = url | callRest( verb="POST", options = {headers : headers} , body=body) | dump(2) %}

 

However, I realized that the webhooks are sent individually (per updated issue), and not in batch. Is there a way to change this ?

 

Thanks in advance!

1 answer

0 votes
Nic Brough -Adaptavist-
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 Champions.
October 30, 2018

To get the screen, all you should have to do is tell the transition to use that screen.  Is that what you have done?

Jenny Mattson
Contributor
October 30, 2018

Thank you Nic!  Closed was setup incorrectly and wasnt allowing transitions to be added.  A case of "cant see the forrest for the trees.  

I appreciate your time :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events