I have created a custom web item in the form of a button using script fragments.
I require this button when clicked to load a Jira screen that is not set to any of the default actions (Create, Edit or View).
In theory this shouldn't be too hard as the feature described works with workflow transitions however I can not seem to get anything to work or find anything on the internet.
Does anybody have a solution that will allow me to link my button to a screen?
I know that it seems like it would not be all that hard ... but scriptrunner doesn't implement the same type of webwork actions that the built-in jira does.
So, what you would need to do, it using 100% custom groovy code, access the screen definition object to find the list of custom fields.
Then for each custom field, lookup the field type so you can prepare what the html UI will look like.
You'll probably need to look up some other configurations from the project such as the field configuration (maybe some fields on your screen should be hidden or required).
And then using all this, construct a custom htmls form using all the correct template for each of those fields.
Now, keep in mind, the button won't work by default. You'll need to create your own javascript to respond to the button click and submit REST api call to either the buil-in rest api or a custom on you build.
Ah, and don't expect scriptrunner behaviours to be active. They won't.
OR
The simple alternative, add a workflow transition from: "Any status" to: "itself". Associate the screen you want. Give the transition the name you want to see on the button.
Bonus features: you can use condition, validators and post functions.
This type of transition will not change the status and do exactly what you want.
The only downside is you might have to add this to multiple workflows.
For context we are looking to Clone tickets into projects based on a project value selected.
So I initially setup a test scenario using the workflow transitions and screens. I then created an automation rule however this would not work as there appears to be a bug which stops Insight custom fields from cloning.
I then looked into scriptrunner and setup the Listener that will clone a ticket. This copies all fields and works as expected, with one issue. Updating the field from the workflow transition screen appears to bypass the listener. Meaning I would have to add 4/5 post-function scripts to each workflow.
Do you know if there is a specific event I need to add for this? Currently I have it set to issue updated and condition is looking at the specific field (It works if I edit through the edit screen directly)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do like the idea of the custom button however at the moment the coding requirements for this piece of work is out of my skillset.
Is there anyway support could be provided to help achieve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use Clone Plus for this purpose: https://marketplace.atlassian.com/apps/44043/clone-plus-for-jira?hosting=server&tab=overview
You would probably spend more on consultancy fees to achieve the same purpose that that plugin would cost over the next 5 years.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another option would be our Jira cloud app Deep Clone for Jira.
From a developers perspective I agreee with @Peter-Dave Sheehan. Cloning and especially moving to other projects is not as trivial as it might seem :)
If you're interested in reading more about automate cloning with Deep Clone for Jira, you can have a look at our documentation:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to clarify with you when you mentioned:-
I require this button when clicked to load a Jira screen
Do you want a dialog to appear went the Button is clicked?
Also, could you please share the current code and configuration that you are using?
Thank you and Kind Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a transition with a screen behind it, when the button is clicked it will load up the screen and allow you to edit fields in that screen.
I would like my button to have the same behaviour, when clicked it loads a screen/dialog that allows me to edit values of fields and submit, changing the values in the ticket.
Looking at another answer this appears like it could be a bit of a headache to implement unfortunately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do really like the idea of the custom button however at the moment the coding requirements for this piece of work is out of my skillset.
Is there anyway support could be provided for this to help achieve the goal?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ram Kumar Aravindakshan _Adaptavist_ iam also interested in this topic. Is there a way to load a custom screen by clicking on custom button :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you intend to trigger a custom screen when clicking a Button / Menu Item or Link, you can do it using ScriptRunner Fragment's Web Item.
You will need to modify the example code according to your requirements.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ram Kumar Aravindakshan _Adaptavist_ Thank you for your answer; i already did it; my Intention is to be able to click on a button and the link opens like a screen. If you link a transition for example that has a screen it will work but look very different because it doesnt overlay the actual issue in a smaller window as usual.
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.