Forums

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

Field order in list is changing

Olli Lutz
January 24, 2022

Hello all,

every time after i set an order of my fields in jira work managements list view and another person joins this project or looks on the list for the first time, the fields are resetted to the default view.

Also the fields i checked and unchecked are set back to default. This is quiet annoying, cause people cant access/see the information from the fields i checked/enabled.

Any idea to solve this? Or is this a bug?

Bests

Olli

3 answers

1 accepted

3 votes
Answer accepted
JamieA
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 Champions.
September 26, 2016

yeah that rings a bell. Try setting the logged in user at the top:

ComponentAccessor.jiraAuthenticationContext.setLoggedInUser(...)

0 votes
Pravin
May 24, 2021

Hi @Adam Yerkman ,

Could  you please share complete script for this ?

0 votes
JamieA
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 Champions.
September 25, 2016

The first line doesn't look correct. I think you want:

ComponentAccessor.userManager.getUserByName("admin")

see https://scriptrunner.adaptavist.com/latest/jira/recipes/jelly-migration.html#_in_code

 

Adam Yerkman
September 26, 2016

You are correct that there was a typo on the first line. Correcting that did not resolve the error that I'm getting though.

I looked through the linked page again and also tried changing it up to get the current logged in user instead of a user provided by me. This would be similar to the create issue script on that page. When running though, it appears that the user gets set to a null value.

JamieA
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 Champions.
September 26, 2016

There is no current logged in user in a service. Even if you run it manually.

Can you add some logging so you can see at what point it gets set to a null value.

Adam Yerkman
September 26, 2016

The NPE was when I tried to log the username of the current logged in user when the service was running. It would be expected to be null since there is no current logged in user.

I put some logging in right before I call the IssueService.validateCreate() method to output the username of the user object I have in the script. It outputs:

Import CSV Service [c.c.jira.csv.CSVImport] Username of user object is: admin

According to the API docs at https://docs.atlassian.com/software/jira/docs/api/latest/com/atlassian/jira/bc/issue/IssueService.html#validateCreate(com.atlassian.jira.user.ApplicationUser,%20com.atlassian.jira.issue.IssueInputParameters), it would use the user I'm passing it, but it seems to be ignoring it.

Adam Yerkman
September 27, 2016

That did the trick. Could you convert that comment to an answer for me to mark as accepted? I feel like that would best to show others that might get here what the solution to this specific problem was.

Suggest an answer

Log in or Sign up to answer