Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,415
Community Members
 
Community Events
185
Community Groups

Question regarding Jira Service Desk and Behavior

Niraj Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 09, 2023

What am i doing:

 

I am trying to create a dynamic form that will fetch data from an API and will display the values as the user use the form. Eg: A user selects a list of services -> It lists the all the available values from the above service -> And continues further based on the what the user is selecting.

I have so far been able to:

1. Created a single choice custom field.

2. Created a single select field for listing the values from the choice of service selected.

3. Set a behavior that points to the #1 field and set the target field(#2) with the values.

4. Able to list the values in the form

 

I have not been able to do so far:

1. Not been able to read the values from step #2 of I have so far been able to

2. While reading the above value, the value is represented as null

3. Value from the log

```

2023-05-09 15:48:30,859+0000 https-jsse-nio-8443-exec-5 url: /rest/scriptrunner/behaviours/latest/jsd/jsd/runvalidator.json; user: xxxxxxxxxxxx WARN xxxxxxxxxxxxxxx 948x80780x1 siy15h 15.65.252.11,172.17.99.83 /rest/scriptrunner/behaviours/latest/jsd/jsd/runvalidator.json [c.o.scriptrunner.runner.ScriptBindingsManager] currentField Form field ID: customfield_10940, value: null

```

3. My code

```

import com.atlassian.jira.component.ComponentAccessor
 
// Define Managers
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
 
def currentField = getFieldById(getFieldChanged())
def currentselectedOption = currentField.getValue() as String
 
log.warn("currentField ${currentField}")
```
Thanks in advance and please let me know if you need any other info.
Regards,
Niraj

1 answer

0 votes
Ken McClean
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.
May 09, 2023

One of the challenges I have faced in the past is that with JSM, the values of custom fields aren't written to the field (in the database) until the issue is created.  This may be the limitation you're running into.

Niraj Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 09, 2023

@Ken McClean Do you have any suggestions on moving forward with your experience with JSM?

Ken McClean
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.
May 09, 2023

We ended up doing a lot of post-processing with a ScriptRunner script. i.e. a listener that listens for issue creation, and if it meets certain criteria, make the changes. For example, if the issue has a value of X in a custom field, set the value of a second custom field to Y.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events