Sending filter results to a MS team channel using Automation
Asked by frankie.medina:

I've set up connectivity from jira to my teams MS Teams Channel and I do get the results the team needs however the formatting in Teams is an eye sore.

**Here is the message i'm sending with the filter results i'm sending.**   

<br />

Hello Team, The following issues are due or have past there due date

{{#lookupIssues}} [{{key}} - {{summary}} - {{Due Date} - {Assignee}}]({{url}}) {{/}}  

I would like to show a bulleted list sorted by the due date ( top down sorted nearest to furthers out )

**Here is my filter:**   

*type = Story and duedate \<= 14d AND product = "Personalization, Engagement Marketing" and status NOT IN ("Deployed to Prod / Closed", Cancelled, done)*   

<br />

**Here is the current result in the teams channel. Everything is just mashed together.**   

<br />

Due Date Approaching for the following Stories

Hello Team,

The following issues are approaching due dates

[OPE-456657 - RHEL 7.xx to 8.xx Upgrade: PEGA CDH Regression test for OpsTest2 Environments - 2024-04-30](https://blueshieldca.atlassian.net/browse/OPE-456657)[OPE-448752 - Care Connect SFMC Configuration Support - 2024-05-31](https://blueshieldca.atlassian.net/browse/OPE-448752)[OPE-446185 - Set prioritization for Dental Care gaps - 2024-07-17](https://blueshieldca.atlassian.net/browse/OPE-446185)[OPE-439198 - Server-side Tracking and Clean Room - 2024-03-01](https://blueshieldca.atlassian.net/browse/OPE-439198)[OPE-439186 - Alternative Format Selection DHCS File Ingestion into RadiantOne - 2022-12-01](https://blueshieldca.atlassian.net/browse/OPE-439186)[OPE-439175 - Alternative Format Selection Data from Shield Advisor into RadiantOne - 2022-12-01](https://blueshieldca.atlassian.net/browse/OPE-439175)[OPE-439174 - Member data for mail service termination letter - 2024-05-31](https://blueshieldca.atlassian.net/browse/OPE-439174)


Answers:
author: Bill Sheboy
body: Hi [@frankie.medina](/t5/user/viewprofilepage/user-id/4804272) -- Welcome to the Atlassian Community!

You could add line breaks, and perhaps include the assignee's displayName values rather than their account id value like this:

```
{{#lookupIssues}}
* {{key}} - {{summary}} - {{duedate.jiraDate}} - {{assignee.displayName}}
{{/}}
```

If that does not help, please lookup the bullet notation for Slack messages and substitute that for the asterisk...or investigate any table formatting notation.

And also...you want to order the results in descending due date order. To do that, change the JQL for the lookup issues action to add this to the end:

```
ORDER BY duedate DESC, key ASC
```

Issues with a blank due date will sort to the top in this manner, and so I added a secondary sort on the issue key so the results are not random in that case. Please adjust it for how you want to sort when the due date values are the same.

Kind regards,  
Bill

comments: author: frankie.medina
body: that was helpful. Thank you Bill. I get the format in a much easier view.

One thing. This change lost the hyperlinks to the jira issues which was in my original message. Any thought how to get that back?


author: Bill Sheboy
body: I believe the link syntax for Slack messages is this:

```
<the URL|the link label>
```

And so you could link to the key and summary like this:

```
{{#lookupIssues}}
* <{{url}}|{{key}} - {{summary}}> - {{duedate.jiraDate}} - {{assignee.displayName}}
{{/}}
```


author: frankie.medina
body: Solved!.. Thank you!


Tags: cloud

jira-cloud