I want to create a button in Jira Cloud using Scriptrunner that is visible to specific roles. Upon clicking this button, I want it to execute a particular script.
After installing Script Runner for Cloud, I am using Script Fragments to create a button. While creating script fragments, I am not getting any options except Web Panel. How can I achieve this functionality?
Hello @Ankush Das
Disclaimer: I have not worked with the ScriptRunner Fragment feature.
Reviewing the ScriptRunner documentation on Script Fragments:
https://docs.adaptavist.com/sr4jc/latest/features/script-fragments
... I see a link to a YouTube video that demonstrates adding a button.
https://www.youtube.com/watch?v=1WdCDhY2OXw
In that demo they show selecting WebPanel for the Fragment type, so I don't think that there is a Fragment Type specifically for Button.
However, as the demo proceeds they do show that what was created does produce a button.
Hi @Trudy Claspill ,
In Jira Cloud, using Script Fragments, I can display an external page, similar to displaying a wiki page in the screenshot.
However, I am unable to create a button as demonstrated in the video or in documentation.
ScriptRunner for Jira - Button on release page using Script Fragments
Creating buttons and REST Endpoints in Jira
I am not seeing these options in Jira Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankush,
ScriptRunner for Jira cloud can display custom HTML, CSS and Javascript, which means you could write some custom HTML hosted somewhere externally, such as CodePen as mentioned in the documentation here.
This custom HTML CSS and Javascript would define the logic to create the button that you require and you would then reference this in the fragment to have the button displayed on the issue.
If you need to communicate with Jira to get data out, you must use the Adaptavist Bridge, as documented here.
If you need further assistance, I would advise raising a support request here.
I hope this helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Speaking to your response that you don't see the same options in your Jira Cloud instance that you see in the demo video and the documents you referenced, be advised that both of those are references for self-hosted Jira (Jira Server or Jira Data Center), not Jira Cloud. The options in Jira Cloud are different.
You can tell that the demo video is not for Jira Cloud by looking at the URL shown in the browser window in the video. It shows "https://localhost:8080". If it was a Jira Cloud instance it would show a URL like "https://someCompany.atlassian.net". All Jira Cloud instances have a URL in the atlassian.net domain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Trudy Claspill ,
Thanks for your response. I understand that the options differ between Jira Cloud and Jira Server/Data Center. Could you please clarify if it's possible to access similar options in Jira Cloud? If so, how can I do that? If not, what is the alternative method for creating a button visible to specific roles?
Additionally, are these options available in Jira Enterprise versions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kristian Walker _Adaptavist_ answered that question:
ScriptRunner for Jira cloud can display custom HTML, CSS and Javascript, which means you could write some custom HTML hosted somewhere externally, such as CodePen as mentioned in the documentationhere.
This custom HTML CSS and Javascript would define the logic to create the button that you require and you would then reference this in the fragment to have the button displayed on the issue.
I don't work with script fragments so I cannot tell you exactly what that code would be.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankush Das,
I'm facing the same error in our Jira Cloud instance. Scripts Fragments refuses to connect. I've already raised a ticket to Adaptavist Support. Come with updates. The ones responsible for the improvements in the Cloud may take action due to negative feedback and enhance a little bit this part of ScriptRunner - to be similar to the one from the Server.
+ One more aspect, and important - the documents rendered on the official page aren't up to date, redirect to materials from 4 years back.
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.