Hello,
I am new to groovy scripting, but have been dabbling recently. Anyway, I am interested in being able to inject HTML elements in to:
I am not sure exactly how to start diving into this. A lot scriptrunner examples are simple and do not go into any detail. Referencing scriptrunner it looks like web fragment is what I need. Documentation and search results on this subject only yield adding something generic. I am still lost on how to bridge the gap with what I would like to do. I did find something called groovy.xml.MarkupBuilder - here. This makes me think there may be some way to traverse the "sections" DOM but I am lost on how to do this.
Any guidance would be much appreciated (examples, resources ect).
Thanks,
Brandon
A common technique to inject and execute Javascript in Jira pages is inserting the Javascript fragments to the announcement banner. It is a bit of a hack, but I know it is widely used and it relies on built-in features exclusively (no need for apps).
But, if you want to do this more elegantly, use an app to managed your JS code: https://marketplace.atlassian.com/search?query=jira%20javascript
Thanks for the insight. Im not super excited about using js in the announcement banner. Additionally, our server won't be getting any new plugins, unfortunately. I submitted this question to Adaptive, so ill see what they respond with. I'll feedback if I get anything that answers original question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I may be wrong, but I'd think that ScriptRunner executes the Groovy code fully on the serverside. If so, it is very unlikely that you can access the DOM.
For that, you should inject Javascript fragments to the pages. Those are executed in the browser and allow working with the DOM (at least in Jira Server).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah I think your right and maybe Im saying that wrong.. Maybe I mean traversing XML? Basically I am wondering if there is a method other than injecting java script into pages to change elements. With Jira scriptrunner "behaviors" you write groovy scripts to change elements, so I feel it has to be possible.. I just dont know much about this. Trying to learn more and would appreciate any help I can get.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.