Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,676
Community Members
 
Community Events
165
Community Groups

Adding custom javascript to issue collector?

Edited

I have been struggling with this, however I think I have a workable solution... however it is not the prettiest thing.

I am wanting to hide the User's Name and Email address fields, as I am populating this from the confluence page automatically.  Using the Fragment locator tool, I discovered that the custom template for an issue collector has:
Panel: wikiRendererWebPanel

I can add a "Show web panel" and add some javascript:

writer.write("""
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".contact-form-fields.field-group").hide();
});
</script>
""")

 

And this WORKS!  However due to a Jira bug, custom issue collector templates no longer work using an iframe in chrome:
https://jira.atlassian.com/browse/JRASERVER-73212
However, when you use the other templates (Got Feedbag? or Raise a bug), 
Panel: wikiRendererWebPanel no longer exists on the page.
So I have two questions...

Is there a better way to do this?  I think you can actually edit the template files on the server but I would rather have a scripted/scriptRunner way if possible.

And second question:
Is there a way to use a condition statement on an issue collector page?  I would like to restrict the code to running on a specific issue collector... however I have no idea how to do this.  I know the snippet shows:
jiraHelper.project?.key == "JRA"

But this didnt seem to work for restricting it to my project key with an issue collector.  I am not sure if I can verify the collector ID or do something else there?  Thanks!

0 answers

Suggest an answer

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

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

217 views 0 6
Join discussion

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