Forums

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

Problem with hiding attachments - java script

Urszula Forenc
Contributor
December 5, 2018

Hi,

in a js file we have a function that hides attachments and some fields from users in fields "Job Interviewer 2" and so on. 

The problem is, that if that user is in this field BUT also  in group "Managers" in the same time, he/she should see this fields.

Could you help us, how to do it?

Our code for hiding:

function removeInterviewer2Fields() {
if (getCurrentUserName() == getJobInterviewer2CSD() || getCurrentUserName() == getJobInterviewer2PBS()) {
hideFields();
if (getCurrentStatus() == 'Contract offeredContract offered' || getCurrentStatus() == 'Contract acceptedContract accepted' || getCurrentStatus() == 'Contract signedContract signed')
{
hideAttachments();
}
}
}

 

Thank you in advance

Urszula

2 answers

1 accepted

0 votes
Answer accepted
Krisztian Kovacs
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.
December 5, 2018

Hi @Urszula Forenc,

would you ever consider trying scriptrunner's hide function?

https://scriptrunner.adaptavist.com/latest/jira/fragments/HideUIElement.html

I've used it a couple of times with conditions similar to what you're describing, though I'm unsure whether it would work for the attachment panel.

0 votes
Urszula Forenc
Contributor
December 7, 2018

But is there an easy way, the exception, lets say (I am not a programmer ;)) "but not in group Managers"?

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events