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

Script Runner Script Field and Custom Field Context

Hello,

    I recently  went through my custom fields that are driven by scripted fields through scriptrunner and added a context to reduce the load on our Jira instance.  Unfortunately this made all the fields no longer appear on jira tickets.

    How I added a context

  • On the custom field configuration screen I:
    • Added a new context that defined my project and issuetype I wanted the fields to appear on
    • Deleted the default context that Jira puts in when creating a custom field.

I have gone back to our test instance to fiddle around with "adding" my context in a different way, and instead of creating a net new context for the custom field and deleting the default one on the custom field, instead, I directly modify the default one to be what I want.  This works and the fields continue to show up on the issues that I expect, but unfortunately in our production instance I am not in a state where I can "bring back the default context and modify it" since I have already deleted the default contexts.

Some other debugging that I have done.

  • I have validated that my new context in the production instance looks exactly like the modification to the default context in our test instance, at least on what the UI shows me.
  • I validated that all of my screens, screen scheme, and issue type screen schemes are setup correctly to be able to display this field.
  • I have used the "where's my field" debugger on the tickets.  The error I get is on Field Value: "The field '<custom field name>' does not have value for issue <Project key>-<key> and will not be displayed on the view issue page. Set value for that field so that it shows up."  It doesn't seem to be running the script anymore...
  • We have reindexed jira in its entirety, and this does not make the field display again on the ticket.
  • I have gone through the atlassian docs on custom field context, and it doesn't seem there are any other options or schemes that I need to create or attach a context to to make it work.
  • I have "reverted" my new context to be exactly what Jira sets up by default (global context [projects and issuetypes], name, description) and the field still does not show up.

Is there something I'm missing here that is special about scripted fields or custom field contexts?  Since I know that changing the default context will make this work again, I can go the route of completely deleting each one of these scripted fields and custom fields and re-creating them, but I'm unsure if I'll be able to get the same name of the field back if I try to recreate the field after deleting.  Since multiple of our JQL filters that drive other widgets use this custom field name, it's important that the name stays the same, at least.  Also other integrations to these fields that list them as a parameter to show (such as displaying this field in a filter results macro) will probably delete that option from showing at the time I delete the field (and before I recreate it), meaning there will be maintenance across many place I don't even know about to readd this to the macro(s) - so I would rather not take this route if I can avoid it.

 

Any suggestions on how I can get out of this mess?

1 answer

1 accepted

0 votes
Answer accepted

@Phillip Saindon , it seems that when one changes the field configuration name, it borks out the script. I do hope you have all the scripts somewhere as the fix is to simply put them back in.

Note also that Jira does allow duplicate field names so you could use precisely the same name if you needed to (and is part of the dumpster fire I inherited that I am still cleaning out). However, when testing here, found that simply putting the script back in the existing fields solved the problem

Thanks to git, yes I have all my scripts saved off.  This is the issue, creating a brand new context does delete you embedded script (at least if you put it directly in the UI of jira, and not on a saved system file).

I'm late to the game here, sorry, but there are some quirks with scripted fields and contexts.  I've seen a bug (no idea if it was SR or Jira or a compound thing) where the searcher changed when you changed a scripted field context, which broke them in interesting ways. 

So I'd want to check searchers were correct, and then, second, which seemed to fix all the other problems I'd had, re-index everything (background, you don't need the full locking one)

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...

97 views 0 5
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