I would like to implement some automation wherein a custom multi-line text field is preset with particular value(s) when the user selects one or more option from a multi-select custom field.
For example, on the Create Screen for the ticket, there is a multi-select menu with the following options:
The user picks Option A and Option C, then they Create the issue. The resulting ticket then has some additional information in a custom multi-line text field:
Some info pertaining to Option A.
Some other info pertaining to Option C.
Is there some sort of script or plugin I can use to achieve this? I tried using ScriptRunner before but didn't get very far.
Thanks for all the replies, everyone.
In the end, I ended up using a long series of Precondition Value Field (JSU) and Update Any Issue Field (JSU) post functions.
It's cumbersome and I'm really keen to update it to something much more future proof and manageable, but for now it works. It's likely to remain like this until we have a dedicated Jira Admin!
Hi, @Stuart_Hart JSU also has JQL Preconditions.
It's possible to cover several different preconditions with 1 JQL Precondition.
There are some Use Cases here: https://confluence-apps.beecom.ch/display/JSU/JQL+Use+Cases
For further assistance with simplifying this with JQL, raise a support ticket here: https://servicedesk-apps.beecom.ch/servicedesk/customer/portal/3/user/login?destination=portal%2F3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could probably do something with the "live fields" functionality in Power scripts for Jira.
One question to ask is what behavior you want when a user types some information into the custom field, and then changes the options. Do you preserve that data or not.
While a little messier, you way want to consider a custom multiline text field for each option, and then use live fields to show/hide the field based on the value of the checkbox.
Yes its custom field sprawl, but it will better protect your users when the enter data and then change thier mind on the options.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This sounds interesting!
From what I'm reading, it sounds like information on the Create/Edit Screens can update depending on what options are selected in custom fields? Am I understanding this correctly?
I'm actually not sure what add-ons we have installed at our company (I'm not the Jira Admin), but if I make any progress on this matter, I'll update this thread with the solution I come to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you can modify the create/edit screens depending on options. Its a little tricky to get used to but works.
Also forgot about Deviniti Synamic Forms. That may help as well.
https://marketplace.atlassian.com/apps/1210820/dynamic-forms-for-jira?hosting=server&tab=overview
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stuart - Welcome to the Atlassian Community!
Automation for Jira should be able to do that for you or the Jira Miscellaneous Workflow Extensions (JWME). Automation for Jira has a Lite version that is free, but both apps will require a fee for the full server version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks John. I believe we have this add-on installed, so I'll explore this as a potential solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With scriptrunner you can do that by adding a postfunction on your create-issue transition on the workflow.
The postfunction script would be between the initial creation postfunction step and the reindex postfunction step.
The logic of the script:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I had previously tried implementing something with Scriptrunner and the logic you've bullet-pointed it basically what I was trying to do. However, I couldn't get the syntax correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you still need it, here would be the code:
You'll have to put the postfunction between the "Create" Step and the "Reindex" Step.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import org.apache.log4j.Level
log.setLevel(Level.DEBUG)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def dropDownField = customFieldManager.getCustomFieldObjectsByName('Your Dropdown Field')[0]
def textField = customFieldManager.getCustomFieldObjectsByName('Your Text Field')[0]
def dropDownValue = dropDownField.getValue(issue).toString()
String newText
switch (dropDownValue) {
case "Option 1":
newText = "Text for Option 1"
break
case "Option 2":
newText = "Text for Option 2"
break
}
log.debug('setting the value of field "'+textField.name +'" to "'+newText+'"')
issue.setCustomFieldValue(textField,newText)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH,false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.