Custom macro - start and end date of the issue to be displayed on a Confluence page
Asked by Anna O.:

Hi everbody,

we want to display **start and end date** of a project o**n a Confluence page** (while this data is all in Jira).

* Does anyone use it like this?
* We got a recommendation to build a **custom macro with Scriptrunner** , but since I am new to programming, should someone **help me with the code block**?

Thanks a lot!

Best, Anna

Here is what the support of Scriptrunner recommended:

I believe the best path forward would be to create a [Custom Macro](https://scriptrunner.adaptavist.com/latest/confluence/macros/CustomMacros.html) that interacts with the Jira API, specifically the [Get Issue](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get) Endpoint, to retrieve your desired Jira issue properties and the present this information within a table, which you can create following the example [here](https://scriptrunner.adaptavist.com/latest/confluence/macros/CustomMacros.html?&_ga=2.159247034.1884786583.1598598410-578515672.1587729876#_lazy_loaded_macros)!


Answers:
author: Davin Studer
body: If you simply want to display some fields from an issue in Jira in a tabular format you should use the Jira macro. You supply the macro a JQL query or filter and then tell it what fields you want to display in the resulting table.

comments: author: Anna O.
body: Hi Davin,

thanks to your proposal!

Start and end date of an issue are in our case custom fields. So I dont see any possibility right now to display custom fields in Confluence. Or do you know how to do it?

As far as I can see, there are available colums: key, summary, issue type, created, updated, due date, assignee, reporter, priority, status, resolution --\> please compare the screenshot.

Thanks in advance!

Best,

![screenshot columns in confluence.png](https://community.atlassian.com/t5/image/serverpage/image-id/108738i9F9475EB553AD063/image-size/large?v=v2&px=999 "screenshot columns in confluence.png")Anna


author: Anna O.
body: Here is for example the filter I created "Start Date" is not EMPTY AND "End Date" is not EMPTY AND issue = TS-507


author: Davin Studer
body: The columns to display initially shows some pre-populated fields but you can change it. The "x" next to each field will remove it and if you place your cursor at the end of the list and click you can add fields ... even custom fields.


author: Anna O.
body: Thanks a lot David! This I did not know. You are awesome!


author: Karen Hayden
body: Using the Jira Issue/filter on a Confluence page and adding Custom Fields to the 'Columns to display' box, displays the column header but not the data. (When there is data present on the Jira.)

Is this a new bug? Or any suggestions to resolve?

comments: author: Reebs
body: I am facing the same issue. Was this fixed? I have a custom date field which has data. But the Jira macros that I am using to pull the information in Confluence is showing the field name but not the actual data.


author: MARTA SOFIA BARRETO
body: I am facing the same issue. Is there any update ?


Tags: com.onresolve.confluence.groovy.groovyrunner

confluence-server

jira

server