Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence label change depending on issue epic link.

Rafał Grochala January 15, 2020

Hey

I know that the topic might be misleading, but the case is a bit tricky, so sorry about that ;).

We've got the case where we have to display 3 states on confluence which is Red/Yellow/Green. (We are going to have 2 Epic Links in Jira Risk and Issue )

Whenever there is issue created in Jira with specific epic link the status/ label has to change on confluence space


ex. I have 1 issue with epic link named Risk, with that i want confluence status/label to change into yellow label (in more advanced case to display a chart with notification what issue is doing that)

If there are no issues with Epic Link Risk or Issue Confluence has to display Green Label
If there are issues with Epic Link Issue Confluence has to display Red Label
If there are issues with Epic Link Risk Confluence has to display Yellow Label

1 answer

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2020

Hi @Rafał Grochala 

Since you are on confluence server, you could implement your own user macro

There you could check the epic state and display with HTML and CSS your state in which color you want :) 

Regards, Dominic

Rafał Grochala January 16, 2020

Thanks!

Although I managed to research a bit about those User Macros.  I managed to create one that is showing me all the issues in a specific project but that's about it. 

I'm going with the approach to base on issue count and on that to have a macro to display me status ( Change the Label of a space)

With that, I'm now stuck since I simply have no idea how to change it to display the numbers instead of a table of issues.

 

## @Param ProjectKey:title=Project Key|type=string|required=true
## @Param ProductName:title=Product Name|type=string|required=true
#set($projectKey = $paramProjectKey)
#set($productName = $paramProductName)
#set($jiraBaseUrl = "")




$jiraBaseUrl/issues/?jql=project=$projectKey%20AND%20"Product%20Name"~"$productName"|count=true

Any ideas on how to tackle this? 

Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2020

Hi @Rafał Grochala 

I would go another way with a JIRA REST API call. 

For that, here is a community post, which helps you to create JIRA REST API call from confluence user macro: https://community.atlassian.com/t5/Answers-Developer-Questions/Jira-REST-API-Call-from-confluence-page/qaq-p/557196

With that, you can get the issue you want to analyze with the JIRA API, which is documented here: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.3/#api/2/issue-getIssue

And then, you have to find the relevant fields and display your status with HTML and CSS. 

User Macros are a little bit "try and error", so sorry for not sending you a proper user macro :) I would also have to try these things out. 

Let me know, it this worked. If not, I try to help you with a proper macro, but for this I would need some time. 

Regards, Dominic

Like Rafał Grochala likes this
Rafał Grochala January 16, 2020

Sure!

I'll try some experiments with Jira REST API Calls, and let you know how i figured this thing out. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events