Dear Atlassian Community, I am currently developing a custom Confluence macro to facilitate the transfer of data from user inputs to Jira Issues macro format. My macro successfully retrieves user-defined JQL and issue fields, processes them on the backend, and aims to publish the resulting data within the Jira Issues macro format. However, I am encountering difficulty in locating the essential macro ID required for embedding the data into the Jira Issues macro. As of my research, I have found no accessible API endpoint to retrieve this macro ID programmatically. Could someone from the community kindly provide guidance or suggestions on how to obtain this macro ID effectively? Any insights or alternative approaches to accomplish this task would be greatly appreciated.
The Jira issues macro format is (i am trying to retrieve id) :
<a href="https://example.atlassian.net/issues/?jql=jqlQuery" data-card-appearance="block" data-datasource="{id: d8b75300-dfda-4519-b6cd-e49abbd50401 , parameters :{ cloudId : cloudId , jql : jqlQuery }, views :[{ type : table , properties :{ columns :[{ key : issuetype },{ key : key },{ key : summary },{ key : assignee },{ key : priority },{ key : status },{ key : updated }]}}]}">https://example.atlassian.net/issues/?jql=jqlQuery</a>
Thank you in advance for your assistance.
Hey @Vikrant Mandle - I know you're asking me about Confluence. Bear with me - I will get there eventually...
So @Sarah Wright was asking about using Automation to insert this "macro" into a Jira rich text fields (like Description).
This allows you to insert a nifty table of Jira issues right into ... your Jira issue Description. (INCEPTION!!!!)
So I'm always up for poking around with Developer tools, and here's what I found.
I this the description below straight out of the API, looking at an issue with an existing table: https://MYSITE.atlassian.net/rest/api/2/issue/EET-293
And I tried modifying another issue using Automation's "Advanced Field Editing":
{
"fields": {
"description": "Testing\n\n[https://roku-sandbox-815.atlassian.net/issues/?jql=project%20in%20(EET)%20and%20created%20%3E%20-7d%7Chttps://roku-sandbox-815.atlassian.net/issues/?jql=project%20in%20(EET)%20and%20created%20%3E%20-7d%7Csmart-card]"
}
}
Alas, all I got was a smart card, with an option to make it into a Link, which sure, sombody could click, but we want it to happen... Automagically
So I had to dig DEEPER. And I found this PUT request when I expanded the smart card into a list:
{
"fields": {
"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "blockCard",
"attrs": {
"url": "https://MYSITE.atlassian.net/issues/?jql=project%20in%20(BUG)%20ORDER%20BY%20created%20DESC",
"datasource": {
"id": "d8b75300-dfda-4519-b6cd-e49abbd50401",
"parameters": {
"cloudId": "MYTENANT",
"jql": "project in (BUG) ORDER BY created DESC"
},
"views": [
{
"type": "table",
"properties": {
"columns": [
{
"key": "issuetype"
},
{
"key": "key"
},
{
"key": "summary"
},
{
"key": "assignee"
},
{
"key": "priority"
},
{
"key": "status"
},
{
"key": "updated"
}]}}]}}}]}}}
The request was a PUT to https://MYSITE.atlassian.net/rest/api/3/issue/BUG-1
Does that "id": "d8b75300-dfda-4519-b6cd-e49abbd50401", look familiar? It's the same ID as yours, which is how I found this post!
I believe that is the "ID" for this "macro" in Jira!
This documentation shows how you could update an issue field using data like above:
ANYWAYS. Confluence. Let's take a peek. Yup, ok, I added a Jira Macro table to a page. It published to this endpoint:
View the source of the page that has the macro and hunt through the HTML for the id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.