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,558,949
Community Members
 
Community Events
184
Community Groups

Behaviour doesn't work "on change"

Hello, im trying to add link via behaviours of scriptrunner (first part of address) to my custom field after user adding value with ticket number (last part of address), but it works only "on load" when im creating ticket, it automatically adding first part of address to my custom field, any idea why it doesn't work "on change"? Screenshot 2023-05-17 at 14.30.20.png

2 answers

1 accepted

0 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

@Ilia Mamontov hi and welcome to the community,

Where is this field located and first filled in? In the portal from the customer?

In addition you have placed a behavior on customfield_10038 and you try to change its behavior when you will change its value?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

@Ilia Mamontov in addition, SR on cloud only work on create screen:

 Please note that Behaviours inside of ScriptRunner for Jira Cloud use the UI Modifications API in order to modify Jira's issue create screen.

Using your script I confirm that everything works (almost) as expected during creation screen. And the script I used was:

const link = "https://google.com/"
const currentData = getFieldById("customfield_10042").getValue()
getFieldById("customfield_10042").setValue(link+currentData)

 

Like Ilia Mamontov likes this

Im trying to make this script for link creating for new and existing issues in my jira cloud, users will add only ticket number in this field, it should be automatically transformed into link with this number in the end, for example user adding ticket number 555, behaviour should convert it to the link: https://freshdesk.com/tickets/555

but now it works only for new tickets, and it creates only link without number, as i understand behaviour should work only after someone adding any value, not before.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

@Ilia Mamontov as I said on my previous comment: Behaviors cloud works only on create screen. So you shouldn't have any problem with your script during issue creation.

For existing issues, behaviors can't do much. I would assume that:

  • you have to create a global self transition (any status to any status)
  • On that global transition place a post function (scriptrunner if you have it, but my cup of coffee is JMWE) with which you will change the value of that field to "link+currentData"
  • Bulk transition all existing issue you want via advanced issue search
Like Ilia Mamontov likes this

@Alex Koxaras _Relational_ oh, i miss this information about cloud behaviour works only on create screen, thanks, i will try another option!

0 votes
Karim ABO HASHISH
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

hi @Ilia Mamontov 

Welcome to the community.

Could you please try with .setFormValue instead of setValue function.

Let me know how it went for you.

Cheers,

Karim

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

@Karim ABO HASHISH setFormValue is only for SR server. On cloud you have only setValue:

sr setvalue.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events