Hi,
I am using Jira Service Desk. I have a requirement that i have a three request types and i have a one custom field which is a drop down field.
Whenever a customer need to raise a request from customer portal I need to set the custom field options based on the selected request type in customer portal.
Note: Here i am not using any Customer Request Type Custom Field.
For example:
Request Types are : A, B and C
Custom field(Type is Drop Down Custom Field) has options like a,b,c,d,e,f g,h
If i select A request type the custom field will set to a,b,c
If i select B request type the custom field will set to d,e,f
If i select C request type the custom field will set to g,h.
Is there any script to perform this operation.
Could anyone please help me with the appropriate solution.
Thanks in Advance
Hi @DevaKiran @Luvo Hubela @Steven Miller @Stephen Letch @Mariano Battaglia ,
On a Jira Service Management Server environment of a customer of mine I solved it with a Behavior (app Scriptrunner).
The script that is used in the behaviour is
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def selectList = getFieldById("customfield_12433")
def customField = customFieldManager.getCustomFieldObject(selectList.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionsMap = options.findAll {
it.value in ["Option A", "Option B"] // list of options you want to show
}.collectEntries {
[
(it.optionId.toString()): it.value
]
}
selectList.setFieldOptions(optionsMap)
Is this an option/solution for you?
Regards,
Marco
Hello @Marco Brundel
Facing the same issue but in Cloud.
Thanks for the code, but this will work only on Jira DC but what's the workaround for Jira Cloud as scriptrunner doesn't yet support behaviors option.
Please suggest if possible.
Thanks,
Adarsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Adarsh Hegde ,
Sorry, but I don't know a solution/work around for the Cloud.
I think it would be a good idea to create a new question here on the community. Also because this question is tagged on Server.
greetings, Marco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
does this script work also on the Customer Portal side?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Consulente Atlassian
Yes, in my situation this behaviour works on a request type on the portal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
I have the same challenge. The solution with configuring new contexts to the custom field does not work here as you can only define a context depending on the issue type (and project).
What we look for is a solution that sets a new context depending on the customer request type (which is NOT the issue type) in the help desk.
Does anyone has expecrience with that?
Thanks & regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am facing the same issue and trying to find a solution. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here. Don't want to create additional fields.
Very bad if you move issues from a -> b -> the fields are empty although the fields name maybe the same. Confusing stuff.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Someone solved it? thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, probably have to use an initialiser with scriptrunner if you have it. Or if you're using Insight fields, have a hidden field and make the field on the portal a reference field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent @Marco Brundel , thank you very much your comment helped me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyone have a solution for this? This is a pretty big deal breaker if it can't do something as simple as supplying custom fields based on request type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyone have a solution to this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @DevaKiran ,
Try configuring a new custom field context for the issue types (request types) and define the various options for each custom field context.
Regards,
Ravi Varma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
in the latest Version of Jira SD it is only possible to configure ONE context per project for each field. I was shocked to see this limitation because I was expecting that we can define as many different contexts for each field combined with different issue types. The configuration screen suggests this functionality, but as soon we start to configure a second context, the project that has been used iin a first confuguration is not available to select.
This leads to a solution of the same semantic field beeing created as a custom fiel multiple times. Bad.
Any chance this could be implemented in future? Are there feature requests pending we could support?
Thanks.
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.