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

Your Points Tracker
  • 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
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?
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

Set text on the create screen for a custom field. Edited

Dear @Alexey Matveev _Appfire_,

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

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

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.

I tried the code above in the create screen.

Sure, @Alexey Matveev _Appfire_  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?

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


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

168 views 6 7
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