Jira macro - add count feature

Hello everyone,

I would like to add to the jira macro a possibility to count the result of a JQL request (cf Loading...).

We thought about 2 possibility to introduce this parameter:

  • Add a new value of the style style parameter, by example style="count". This would be the simplest solution as it don’t require to create a new macro. And this will be less confusing for user which come from confluence as in confluence it’s the same macro, so user which search for the possibility to count the result with the jira macro they will directly found the way to do it.
  • Create a new macro jiraCount. The advantage will be that it will be more clean on the parameter handling. The jira macro have a lot of parameter (maxCount, parameters, fields, fieldNames, style and source) which is not needed to just count the result of a JQL.

What do you think ?

Thanks for sending the proposal.

Big +1 for a new macro for the reasons I mentioned at Loading...

Definitely, and it’s a bit more than not being needed. They just wouldn’t work. Thus the doc for the macro would need to say these parameters will work for all styles except the count one. That’s a sign of a design issue.

And you’re right that counting when the source is a fixed list of jira issue is not very interesting to say the least :wink:

Thx

Note: It also makes it simpler to use:

{{jiraCount id="myid"}}
category=10000
{{/jiraCount}}

vs

{{jira id="myid" style="count" source="jql"}}
category=10000
{{/jiraCount}}

Technically it’s not much more complex to implement since the jira api already provides source components, and everything needed are available in a reusable way already.

Also makes it simpler to implement in the Macro picker dialog since we would need to grey out parameters that shouldn’t be selected when style=count.