Create new web item with dialog for fast creation of tasks based on data in dialog

Alexander Raymukanov January 22, 2021

Dear community,

please help to find right way how to do it.

Usercase:

I need a new button (web item, in opsbar-operations).

2021-01-22 17_58_49-Clipboard.png

When I will push it, new dialog or jira screen will be shown. In this dialog I need to place multiple checkboxes or list with multiple choices to choose type of tasks to create.

When I will push submit button, new tasks of selected types will be created based on data from dialog and fields values of actual issue.

 

 

I know how to use scriptrunner(groovy scripts) and jira automation add-ons, write simple java/javascript code, but can't write full add-on.

Simplest but terrible way is to create new transition for each status that goes to the same status and assign there screen with 1 custom field (list with multiple choices). Then create in "automation for Jira" listener of this field change and create issues based on field value. But this way looks not the rightest.

"Automation for jira" allow to create new web-items if manual trigger is selected, but it cannot trigger dialog or jira screen.

Scriptrunner can create web items with dialog, but I dont know exactly how to make that dialog so that it will start scriptrunner script or trigger automation for jira rule.

Please help in which way should I dig

 

Regards,

Alexander

1 answer

1 accepted

0 votes
Answer accepted
Max Lim _Adaptavist_
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 24, 2021

Have you taken a look at the documentation: Web Item: Dialog (advanced)?

It have a simple example for you to build on. You need to build your dialog from ground up though.

You can certainly setup a transition screen with multiple list custom fields and create your tasks via ScriptRunner's post-function/listener, and even linked these created task issues properly. I am not sure why you need to involve "automation for Jira" in this case.

Alexander Raymukanov January 28, 2021

Good day Max,

I checked yesterday full documentation section, and didn't find simple example/explanation how to combine all parts together.

If I understand correctly

1. I create new REST Endpoint with .groovy file that will read needed context and have html code for construction of dialog form.

Question: how to create form with elements like user picker field? (text field with custom js?)

2. I create  new web-item in section operations-top-level: set place, key, type=code and dialog, condition=true and set link to REST Endpoint created in 1

3. I create new web resource fragment with .js file and write all logic that needed on button click or another action on form.

Question: Link between html description of element and js code  is done by right ids of elements. But when I create web resource I need to set context, what context should I choose?

Max Lim _Adaptavist_
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 28, 2021

Unfortunately, I can simply recommend the feature. The rest is beyond my experience.

As I mentioned, I don't think your use case requires such advanced feature.

Alexander Raymukanov January 28, 2021

Thanks , I made it this way. 

May be I will find later time to learn using js and html in jira

Suggest an answer

Log in or Sign up to answer