Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,744
Community Members
 
Community Events
168
Community Groups

Create a custom button or custom link on issue view

Been searching on that topic for HOURS but couldn't find a single suitable solution. What I am after : I need a custom HTML BUTTON or custom HTML LINK that when clicked, will open a new browser tab and follow that link.

What I have tried : Jira built-in URL Field. It works but it's just SUPER UGLY as the entire link just displays and it seems there is no way to display the link as a standard HTML <a> element. My link is a long URL string with lots of parameters so I get something like

https://api.mywebsite.com/intervention/add?id={{issue.key}}&param1=ABCD&param2=EFGH&param3=JKLM&param4=NOPQ&hash=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Which obviously is TERRIBLE in terms of user experience.

Then I found several articles saying I should create a WEB ITEM with Scriptrunner but after reading dozens of documentation pages, I found out that WEB ITEM is NOT available on Jira CLOUD (only on Server).

So is there really no way to create a SIMPLE HTML LINK or a SIMPLE HTML BUTTON to just open an external link???

1 answer

0 votes
Alex Koxaras Community Leader Aug 17, 2022

Hi @MrUpsidown 

You can't create a custom HTML button on Jira. What you could do it to create a multi line text field (call it URL or whatever), which allows you to link a word/phrase/string to a URL:

link.png

Does the above help you?

Hi, yes, I have tried that as well by now. Took me another 30 minutes to figure out how to write these links (I need the links to be written in the field via Automation) since the only documentation I have found doesn't provide details on how a link with a description should be created and the field editor itself does not have a "view source" mode or anything like that, that would allow to see what's "behind the scene".

I later found out my link should be entered as [Link description|https://url-to-website.com] which leads me to ask myself one more time : "Why is Jira not using Markdown???" but anyway! Thanks for pointing me to that direction.

I find it really quite unbelievable that there is no simple way to achieve that with like a simple LINK FIELD or BUTTON FIELD or HTML FIELD or such. I just don't get it. In some areas, Jira can be customized to the extreme, and in other (very basic) areas, you just can do NOTHING except ugly workarounds. 

Alex Koxaras Community Leader Aug 17, 2022

It's all about security and/or different priorities I presume.

In any case, can you please describe your need/business requirement in order to see if there is anything we can do to provide a solution for you?

  • Who is providing this link you are saying and/or where do you acquire it from?
  • Do you have any apps likes JMWE, scriptrunner, JSU installed?

All I need is the following automation :

  • When an issue is created
  • Generate a link which includes the issue key, something like https://mywebsite.com/something/ with the {{issue.key}} at the end (with some more parameters that can all be processed via Automation)
  • Place this link (or button) somewhere on the issue view so that support agents can click on it when needed

I don't have JMWE or JSU installed. I had Scriptrunner installed until I found out that the only thing I was after (Web Item) was unavailable for Jira Cloud.

Alex Koxaras Community Leader Aug 17, 2022

Try the following:

  • Create a multi-line text field (in my example is called "paragraph"
  • Go and edit the field configuration used for the specific project
    • find the "paragraph" field and click "Renderers"
      click renderers.png
    • Change the renderer to "Wiki Style"
      renderer.png
  • Go to your project and create an automation rule
  • Test your rule

You should have a result like the following:

resultt.png

 

Hope the above helps! :)

Like MrUpsidown likes this

That's exactly what I have done but with a Text Field (multi-line) for which I have set the renderer to Wiki style. But it still feels like a workaround and not a proper solution one would use in production.

First: the field can be edited, which means that even if by mistake, an agent can delete or modify the link which might then stop working (sure I could reset the field value every time the issue is saved or transitioned, but that feels like one more hack/workaround).

Second: I would expect from JSM to be able to place such a link (or even better, a button), in the menu or in some dedicated section and not have these in the middle of my other issue content fields.

It works, but it's not nice and really doesn't feel right.

Alex Koxaras Community Leader Aug 17, 2022

Remove the field from the Edit Screen then and no one will be able to edit it.

Ah yes, that's right. Done and works as expected.

Since we're at it, do you know if there is an option using Wiki markup to open the link in a new tab, as you would do with a target="_blank" on an HTML anchor?

Alex Koxaras Community Leader Aug 17, 2022

@MrUpsidown unfortunately I wasn't able to succeed opening the link in a new window by adding any kind of parameter within the link. This issue https://jira.atlassian.com/browse/JRACLOUD-9380 describes Atlassian's decision in keeping it as is, rather than opening by default external links in new tabs.

Like MrUpsidown likes this

Default, default, default. Why do we not have an option? There are many different use cases and I don't understand why Jira administrators would not have that choice. Thanks for trying though.

Like Alex Koxaras likes this
Alex Koxaras Community Leader Aug 18, 2022

@MrUpsidown if you read the link I've send you they state:

We assessed multiple approaches and landed on keeping the existing behaviour for the following reasons.

For users in the editor:

We don’t want a user to be moved away from the current work they’re doing so open the link in a new tab by default. This is common behaviour.
For users in the renderer:

Common link-click behaviour on the web is to open in the same tab.
If we open links in a new tab by default, it’s impossible for a user to open the link in the same tab. For opening in same tab by default, however, there are common ways to open in a new tab, like cmd + click (Mac), ctrl + click (Windows & Linux), right click then select open link in new tab, or pressing the middle button on a mouse.
From an accessibility standpoint it is better to stick with the default browser behaviour and open links in the same tab. The main arguments for this are:
Assistive technology users can become disoriented when a link opens a new tab or window. They cannot use the back button to return to their previous location. We want to minimize this as much as possible. We have a toolbar button for opening links in the editor to give those with accessibility needs guidance that a new tab is opening.
People with mobility or dexterity issues who rely on a keyboard may find it difficult or painful to perform additional navigation tasks.

For both the renderer and editor:

We decided against giving user-level control of how their links open when clicked. Aside from the accessibility and other reasons mentioned above, we believe this could cause confusion to consumers of the content. This is because every link could hypothetically open in a different way. It wouldn’t afford the consumer of the content a predictable experience when clicking on a link.

Yeah thanks, I was refering to that ticket, I have even commented on it.

Alex Koxaras Community Leader Aug 18, 2022

@MrUpsidown if that's ok with and you think that this is the best answer you could get, kindly mark my answer as accepted, in order to help others with similar request. Cheers :)

@Alex Koxaras I will not mark your answer unless I am provided with a VIABLE solution.

This is not a VIABLE solution. Maybe a workaround the total lack of common features that SHOULD be bundled into a product like Jira.

Multi-line text field workaround is a fail.

1) There is no way to specify whether the link opens in a new window/tab or within Jira which is a total pain (and I don't care that decision you pointed me to! btw. have a look at the recent comments and judge by yourself on how unpopular that decision is).

2) If the field containing the link is part of a transition screen, the field WILL NOT SHOW THE LINK. Instead it will show the markup which makes the link unusable and not clickable. One more total pain.

In other words, there is NO SOLUTION that I have found so far and that is USABLE to include an HTML link, or HTML button to a Jira issue.

Fair enough!

On second thought @MrUpsidown.. You did get a viable solution. A URL redirecting you in the same tab. And to set the record straight, you did get a partial solution to your problem:

Been searching on that topic for HOURS but couldn't find a single suitable solution. What I am after : I need a custom HTML BUTTON or custom HTML LINK that when clicked, will open a new browser tab and follow that link.

So you you got that custom URL which redirects the user, but not on a new window. However, since you feel that you didn't get what you exactly wanted, it's fine. No worries about that. Cya.

 

No. It's not viable. We need these links to be clicked when on a transition screen. While this works in the mobile app (the fields are rendered, which means the links are clickable), it won't work for desktop users as the fields appear in editor mode (not rendered so they are not clickable).

I will add to what I have already said that Jira is an unusable pile of uncontrolled functionnalities that don't even behave the same way whether you are on a desktop computer or on the mobile app.

We have a complex workflow / use case. I have been told that Jira was the most flexible tool on the market but every single thing I am trying to achieve is a total pain, or needs a workaround, or will lead me to an existing bug or feature request that has been dormant for years. In other words, I am stuck.

If I had known that 95% of what I wanted to achieve would be a pain, I would never have chosen Jira. My mistake. Entierly.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events