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

Set text on the create screen for a custom field.

Edited

Dear @Alexey Matveev,

I have a question How do I set the pre-text already present in the custom field in the create screen. My code works best in edit and view screen but I'm unable to find the ID value for the create screen of the same .

As always thank you very much.

 

1 answer

Suggest an answer

Log in or Sign up to answer

Like even if i put something like this in the behavior tab, still nothing happens, would you be able to assist me.

Alexey Matveev
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.
Apr 04, 2018

I just tried your code and it worked for me.

You can change the code like this

def apply = getFieldById("customfield_19896")


log.error("apply: " + apply)

if (! apply.getValue()) {
apply.setFormValue("Hi do not replace the revision value kindly update here")
}

Then open the necessary screen and have a look in the logs.

In my case the log looks like this:

/rest/scriptrunner/behaviours/latest/validatorsByPid.json [c.o.j.groovy.user.FieldBehaviours] initForm field ID: customfield_23100, value: null
 

You see "field ID" is not null, which means that the custom field was found, and the value is null, which means that your if condition will work.

Alexey Matveev
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.
Apr 04, 2018

I tried the code above in the create screen.

Sure, @Alexey Matveev  but after the using the code, I did have the edit screen not loading for ever, and I needed to refresh the page and edit which is not desirable at all.

Like if i remove the code from the behavior, the edit page loads fine. Is this fixable?

Alexey Matveev
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.
Apr 05, 2018

Hmmm. that is strange why the code makes your edit screen freeze. Kindly have a look in the logs and try look for errors. 

I will update you once i see any errors

 

TAGS
AUG Leaders

Atlassian Community Events