We have a one master defect project site, and two other project sites that act as a filter and when the observation is put in the Approved closure status that record is cloned and created in the master defect project with a link between the two. The issue we have is that we want the master list of versions to be on the master defect project site, but records created in the other sites still need to be able to select the versions from the master list. How can we setup a version picker field in other project sites, where the version values are those that are listed in another project?
We have Adaptavist scriptrunner, so I imagine we can achieve this via a scripted field or a behaviour. Could someone provide the details of what we need to enter to achieve this functionality?
Thanks
Hey @Dan Hellings You can achieve this with scriptrunner.
Use a behaviour on a textfield and create initialiser script function.
Here's a good documentation link to do something like this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Brittany Wispell , If i was to use the behaviour on a text field, do you know what code i would have to enter in order to display the version list of one or more project sites?
The examples of the code that I need to write are the following:
1) A custom field in Project Site A that allows the user to select one or more versions from the Version list of Project Site B.
2) A custom field in Project Site A that allows the user to select one or more versions from the Version list of Project Site B, Project Site C and Project Site D.
Apologies but i do not specialise in coding, so any help would be really appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Dan Hellings
Here is an example. You'll need to put this in a behaviour. It is located separately from the rest of the ScriptRunner options.
//Behaviour//
getFieldByName("TextFieldA").convertToSingleSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/scriptrunner-jira/latest/issue/picker",
query: true, // keep going back to the sever for each keystroke
// this information is passed to the server with each keystroke
data: [
currentJql : "project = SSPA ORDER BY key ASC",
label : "Pick high priority issue in Support project",
showSubTasks: false,
// specify maximum number of issues to display, defaults to 10
// max : 5,
],
formatResponse: "issue"
],
css: "max-width: 500px; width: 500px",
])
Or you could use the Atlassian Rest API.
Here is a link to documentation.
Rest API Project Get Project Versions
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the above behaviour produces a list of issues to pick from. My request is to be able to select from a list of Releases/Versions. What code would I have to add to be able to sget this functionality?
Also when you select an item, only the Key is displayed in the view screen. Is there anyway to show the Key and summary?
Thanks again,
Dan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dan Hellings you'll have to modify the code and use the information from the rest api to return the versions. The code I provided is a starting out point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Were you able to solve this?
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.