how to hide "active sprint" using web resources

sgole
Contributor
February 10, 2021

hello ,

i want to hide " active sprint " which is shown in figure . using javascript (web resources)

image.png

 

 

1 answer

0 votes
mogavenasan
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.
February 10, 2021

Hi @sgole,

I tested this on browser Console and it worked:

$("[data-link-id=\"com.pyxis.greenhopper.jira:project-sidebar-work-scrum\"]").remove()

I hope that this helps.

Thanks,
Moga

mogavenasan
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.
February 10, 2021

And yea, it's jQuery. Let me know if you need that to be Javascript.

sgole
Contributor
February 23, 2021

hii @mogavenasan ,

i have used above code in web resources(.js) but its not working . can you please suggest something else 

mogavenasan
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.
February 23, 2021

How about you place that inside the Jira Announcement banner? Make sure you have added some logic before removing the element, for example, check the URL and check if the element exists and etc.

sgole
Contributor
February 24, 2021

hii @mogavenasan ,

 i need to use web resources

mogavenasan
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.
February 24, 2021

Hi @sgole,

I don't understand what you mean by "web resources".

When you mentioned that it's not working, have you tried to do some logging? Does the Javascript able to find the element on the page? Is there any error on the Console log?

sgole
Contributor
February 25, 2021

hii @mogavenasan ,

i have create fragment- web resources like below .

image.png

and in HideCf.css i have written ,

$("[data-link-id=\"com.pyxis.greenhopper.jira:project-sidebar-work-scrum\"]").remove()

but it wont work .

mogavenasan
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.
February 26, 2021

Hi @sgole,

I don't think jQuery commands should be placed in a stylesheet file (.css). And this Install web resource - is this from Scriptrunner?

Are you sure you are using this function correctly? You might want to refer to this doc for a better understanding. For the Context(s), how did you deduced to jira.view.issue

Suggest an answer

Log in or Sign up to answer