Set securityLevel on 1st sync

Originally asked by Berry Kersten on 11 June 2020 (original question)


Hi,

I have a use case where the securityLevel only needs to set on the first sync, for example:

  • Source side: no securityLevel present
  • When 1st sync: set securityLevel to XX

In the documentation I only see code snippets where SecurityLevel names are identical or don’t match.

But for this use case I’m not sure how to set this.

Thanks!


Comments:

Berry Kersten commented on 11 August 2020

Juan Grases any idea’s for this usecase? Thanks!

Answer by Juan Grases on 11 August 2020

You can probably do something like:

Target side:

if(firstSync){
   syncHelper.syncBackAfterProcessing()
}

Source side:

import com.exalate.basic.domain.hubobject.v1. BasicHubIssueSecurityLevel
issue.securityLevel = new BasicHubIssueSecurityLevel(null, "name", null)

Making sure you use the right name.