Scripted Fields does not appear on the relevant screen.

Maybe I got it all wrong but ..

I'm trying to show a message to the user when he creates a ticket,

I created a custome field, type "scripted field", ( searcher none ) and update the script field with this code

import groovy.xml.MarkupBuilder
StringWriter writer = new StringWriter()
MarkupBuilder builder = new MarkupBuilder(writer)
builder.div (class:"aui-message info shadowed") {
        p (class: "title") {
            span (class: "aui-icon icon-info", "")
            strong ("message for user")
        }    
    }
return writer

with HTML template.

The preview is showing resault as expected.

I updated the relevant screen with the field ( According to Admin helper Plugin, it should appear on the screen ) and ..... nothing ... the field does not appear on the relevant screen.

What am I missing?

1 answer

1 accepted

Thanks,

According to Admin helper Plugin, it should appear on the screen

If you inspect the html near the field title on that screen - do you see any of the code you're returning from groovy ? Have you checked for any errors in the log file ?

Thats the problem ... I don't even see the field title..

No error in the logs ( catalina.out or browser console ) ..

Set the com.onresolve.jira.groovy to DEBUG and try again to see if something will come up in the atlassian-jira.log

Is it a "view" screen and not an "edit" screen right? Calculated fields only show on view screens.

I knew I was missing something ...

Is there a way to achive it ( have a message to the user ) in the create / edit screen?

you could try: https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields#ScriptedFields-DisplayingScriptFieldsinTransitionScreens- worked for me but I think the last report I had was that it didn't work.

Thanks Jamie,

It did'nt work for me either.

Let me know your jira version and plugin version, I will double-check if I get a chance.

jira - 5.1.4

script runner - 2.1.15

hrm... probably only works in 6+

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot