Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

issue.setSecurityLevelId() not working in workflow post function

Hello all,

I need to set the security level based on the value in a custom field. I'm able to get the correct schemaId, but can't get the line issue.setSecurityLevelId(10108) to actually work.

I've removed all other lines of code and used only the following with no luck whatsoever:

issue.setSecurityLevelId(10108)

I've checked the atlassian-jira.log and nothing shows up. When I use the following:

log.debug("before running issue.setSecurityLevelId((Long)10108)")
issue.setSecurityLevelId((Long)10108)
log.debug("after running issue.setSecurityLevelId((Long)10108)")

I do get these log entries:

2017-10-06 12:31:10,937 http-nio-8080-exec-10 DEBUG dbtest2 751x164438x1 vmctwj 192.168.20.143 /servicedesk/customer/portal/195/create/284 [c.o.s.jira.workflow.ScriptWorkflowFunction] before running issue.setSecurityLevelId(10108)
2017-10-06 12:31:10,937 http-nio-8080-exec-10 DEBUG dbtest2 751x164438x1 vmctwj 192.168.20.143 /servicedesk/customer/portal/195/create/284 [c.o.s.jira.workflow.ScriptWorkflowFunction] after running issue.setSecurityLevelId(10108)

I have verified that the user making the request from the portal has the Set Security Level permission on the project. I have no idea what else to check.

Thanks in advance!

1 answer

0 votes

I don't think it's this, but is the user part of the rule for the new level?   Can they change the security level to the desired one by editing the issue in the UI?

Are you making other changes to the issue in the script?  If so, are they working?

There is no option to run under the context of a specific user, so I assume the post function will run under the current user's context (see attached screenshot to see what it looks like to define this workflow post function).

Also, I tested this as an administrator (full project permissions) and still no luck. I'm completely at a loss. Any help is very much appreciatedCapture.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Do Not Lose your Customer’s Trust

Missing deadlines is one of the biggest problems every team lead wants to avoid when dealing with managed services. When the customer contracts your company to help with IT services it is expected th...

24 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you