Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with injecting JS to change description in insight

Marek Hoffreiter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2022

Hey guys,

anyone has any experience with injecting JS via announcement banner to only certain parts of the application ? 

In my use case, I need to change the description in insight object Attach Files "screen". 

Screenshot_97.png

If there is any other/better way to do this, I am more than welcome in trying it out.

Thanks

Marek

 

1 answer

0 votes
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2022

For something like this (not that this is best practice), I would use a public library like "arrive"

Then you can respond to the "arrival" of an object on screen with a line of code like:

AJS.$(document).arrive('#rlabs-attach-file .description', function(){
this.innerHTML = "Your custom description";
this.borderStyle = 'solid';
this.borderColor = 'red';
})

If you have scriptrunner, you can deploy arrive as a global resource, otherwise, there might not be any choice but to include the minified arrive into your announcement box (about 5k) - if that's even possible. 

Maybe there are better ways. Such as MutableObserver

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events