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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

JMWE - Sending issues in batches using callRest function

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

1 accepted

1 vote
Answer accepted
David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 31, 2023

Hi @Hugo Michelez 

The workaround is to modify the jql selector to return just one issue (limit the result to one issue) and then, in the post function, use the searchIssues Nunjucks filter to run the same jql search to retrieve the whole list of issues. 

However, you'll need to limit the fields returned by the issue search, otherwise you'll run out of memory. 

It works perfectly!

 

Thanks a lot, @David Fischer _Appfire_

Suggest an answer

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

Atlassian Community Events