Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How do I get results from searchIssues and use the returned values in a callRest()?

I'm trying to use a JQL filter to find a list of issues, and then include that information in the text of a call to an incoming webhook in Teams. I'm struggling with passing around the information/doing things correctly. I currently am doing this in Jira's automations, but would prefer to use JMWE going forward.

I have the query that finds the issue, and I have an idea of how I will be using callRest, but I'm not sure how I would take the results of the search and loop through them in the "text" section in the call to the webhook... any pointers would be appreciated!

{{ "project = \"Tech Support\" AND statusCategory != Done AND \"EquipmentOptions[Checkboxes]\" in (Laptop) AND \"Equipment Shipped?[Checkboxes]\" is EMPTY" | searchIssues(100, fields="url,summary") | }}


{{ "insertWeebookURLHere" | callRest(
verb="post",
body={
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "A New Laptop has been Requested!",
"sections": [{
"activityTitle": "There are currently " + issueLookupSizeHere + " in the queue that require a laptop to be shipped out:",
"text": "",
"markdown": true
}]
}
) }}

1 answer

1 accepted

0 votes
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.
Nov 08, 2023

Hi @Drew 

You just need to replace the first part with:

{%set issueLookupSizeHere = "project = \"Tech Support\" AND statusCategory != Done AND \"EquipmentOptions[Checkboxes]\" in (Laptop) AND \"Equipment Shipped?[Checkboxes]\" is EMPTY" | searchIssues(100, fields="summary") | length %}

Hey David,

Thanks for the reply, that did work for me! I'm new to using nunjucks and JWME so I'm still getting the hang of it. Ultimately I was able to accomplish everything I wanted to, and this helped me get there. Much appreciated!

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