Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ScriptRunner Behaviours in Service Desk Customer Portal not working as expected Edited

Hi,

I created a Behaviours script to show/hide one of seven custom fields (B1-B7) depending on the selected value of another custom field (A).
The behavior is defined on field A, with no initializer code and it's mapped to my project as a JIRA project.
Field A is defined as Required so it's displayed in the Create screen.

It works as expected when I create a new issue in the Jira UI.

Next I created an identical behavior, on the same custom field (A), with the exact same groovy script. I mapped it to the same project, but now as a Service Desk project.

This is per the Behaviours documentation.
So I have two behaviours, on the same field, same issue type.

Now in the Service Desk project admin, I added field A (via Request Types ->Edit Fields) to the request type which is mapped to the relevant issue type, so that it will be visible when creating a request.

However, when I log in to the customer portal, and I create a new request, I only see field A, but B1-B7 are not displayed.

Next I configured fields B1-B7 to be visible, and now all are always visible, regardless of the value set in field A.

I've submitted a ticket to Adaptavist, but in the meantime I wonder if anyone got this (or similar) functionality to work in Customer Portal.

1 answer

IIRC, my problem was that some validators were failing and thus the behaviour was not invoked.

The way to debug is twofold:

1. Add logging (using com.onresolve.scriptrunner.runner.util.UserMessageUtil). Be aware that there may be some delay until the log messages are displayed

2. Open the browser's inspect, go to the console, clear the contents (CTRL-L), then modify the value in the field and observe what happens in the console.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

72 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you