Forums

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

Convert Jira Key to String

Saira
Contributor
August 31, 2023

Hi, here's my use case

When a Confluence page containing text 'Page for abc-123' is created , I want to link it to a Jira with the key abc-123. 

This would require comparing a string (title of wiki page) to key (Jira ID).

Is this even possible? 

2 answers

0 votes
Rilwan Ahmed
Community Champion
August 31, 2023

Hi @Saira ,

Confluence page titles don't render URLs. Even if you add full Jira ticket url in Page title, it is displayed as text.

But when you add the jira ticket url in page content, it renders details from Jira.

image.png

This is he screenshot from Confluence page. Same URLs are added in page title and content. In Page title, the url is considered as text where as in page content, it is rendered as url and due to application link between jira and confluence, it is displaying jira ticket details in confluence page. 

0 votes
Benjamin
Community Champion
August 31, 2023

Hi @Saira ,

 

This is possible. What you do is add the link with the your "text" and add the URL which is the link of the actual jira ticket. So, when user click on the text, they will be redirected to the Jira ticket.

 

HEre's the documentation on all the different type of linking you can do.

 

https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#

 

Hope this helps.

 

-Ben

Saira
Contributor
August 31, 2023

it's not that simple :) Its' not a static / predictable URL or Jira. I don't know what Jira ID will be - all I know is there is a page with a title for syntax: Page for abc-123. If there's ever 

 

A jira exists with ID abc-123

A page is created with title syntax: Page for abc-123

The automation needs to detect when the page is created, so it would compare the page's title and then look for issues that have a ID of abc-123. In Confluence's automation, I can add a check for title~'abc-123' 

but after that what do I do? It does not give me an option to look up Jira issues with that key, and even if it did, I'd need to convert it the key to a string so that I can compare with the string abc-123 from the title. 

Benjamin
Community Champion
August 31, 2023

Hi @Saira ,

 

What's the use case of this automation so that other members can offer possible solution. What's the "why" behind it?

 

In order to look up Jira issue, one way is to use the Jira API and add the issue key string into the API call and see what the return call is. 

Saira
Contributor
September 1, 2023

Use case is automatically linking a wiki page upon creation to an associated Jira ticket. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events