Best approach to display information from Stash to a Jira screen without saving unwanted data?

Deleted user July 18, 2016

Hello

I would like to start this question by explaining what I am trying to achieve. I'm creating a new Jira screen, full of my required custom fields, which will have a connection with Stash. This connection is used so that on the Jira screen I can select from a list of project repositories, and also have a second select list consisting of the last 15 commits performed on the selected repository generated.

I've been using the scriptrunner plugin in order to create this connection using a groovy scripted field, where initially I was updating a single-select custom field to populate it with the list of project repositories. However, by using this approach, I realized that it would get very messy as the number of commits on the second select list gets updated over and over, creating many entries on the Jira database (at least from what I understand, this assumption might be wrong but I haven't found clear information on this).

The next approach I considered was using the scripted field to return an HTML/MarkupBuilder string consisting of a select list with the appropriate options, and having that added onto the Jira screen, where the selected value could be saved on a read-only custom field and there would be no need to save the select options anywhere in Jira. However, this approach has left me stuck, as I cannot figure out a good way to display the HTML/MarkupBuilder content on the screen. I'm sure I might be taking the wrong approach on this, but I just cannot find the way to get this to display on the new screen. Am i supposed to add it as a temporary field? Or is there some special way to display html content on the screen?

What i know I do not want is to save the select lists anywhere in Jira, as the contents will change over time. The only thing I want to record in the created/updated JIRA issue are the selected options in a couple of read-only custom fields.

Any input is appreciated!

1 answer

1 accepted

1 vote
Answer accepted
JamieA
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.
July 18, 2016

This is pretty much exactly what select list conversions are for.

Set up rest endpoints to get those bits and pieces, and a behaviour to convert text fields to pickers.

Deleted user July 19, 2016

Thank you, I will definitely be looking into this in more detail. I'm pretty new at using script runner, so I am not fully familiar with the entire usage quite yet. The last question I wanted to bring up was regarding the second select list in my requirements. Its values are completely dependent on the value chosen for the first select list. So if I were to use select list conversions, I assume that a behavior would handle updating the list of available options based on the current value of the first list?

JamieA
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.
July 19, 2016
Deleted user July 19, 2016

Once again thank you, the help is greatly appreciated!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events