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"?
@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?
@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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Koxaras _Relational_ oh, i miss this information about cloud behaviour works only on create screen, thanks, i will try another option!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Karim ABO HASHISH setFormValue is only for SR server. On cloud you have only setValue:
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.