Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

How to sync security level in cloud instance

 
1
0
-1

We are trying to sync the security level in cloud instance by taking default assignee to set the particular security level group in cloud instance end.


Please find the attached error screenshot


    CommentAdd your comment...

    4 answers

    1.  
      1
      0
      -1

      Hi,

      Here is the solution using script:

      if (!firstSync) {
      
      def jiraUrl = "https://demo.atlassian.net/rest/api/3/issue/${issue.key}"
      def user = "abc@demo.com"
      def apiToken = "<token>"
      def authString = "$user:$apiToken".bytes.encodeBase64().toString()
      
      def securityId = "10002"  // Change this to your actual security ID
      
      // Set up URL and connection
      def url = new URL(jiraUrl)
      def http = url.openConnection()
      http.setRequestProperty("Authorization", "Basic $authString")
      http.setRequestProperty("Content-Type", "application/json")
      http.setDoOutput(true)
      http.setRequestMethod('PUT')  // Change to PUT if needed
      
      // Prepare JSON payload for the security level
      def payload = groovy.json.JsonOutput.toJson([
          fields: [
              security:[
                id:"10003"
              ]
          ]
      ])
      // Send the request
      def outputStream = http.getOutputStream()
      outputStream.write(payload.bytes)
      outputStream.close()
      
      // Get the response
      def responseCode = http.getResponseCode()
      //debug.error("Response Code: $responseCode")
      
      if (responseCode != 204) {
          def inputStream = responseCode >= 400 ? http.getErrorStream() : http.getInputStream()
          def response = inputStream.text
          debug.error("Response: $response")
      }
      else
      {
       //debug.error("done")
      } 
      }


        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Sonal,


        Please provide an update.


        Regards,

        Uday

        1. Sonal Otwani

          Hi Uday Bhaskar 
          Sorry for not providing update till now. Can you please click "copy to clipboard" button below the error details and provide those copied information?

          Thanks,

          Sonal

        2. Uday Bhaskar

          Hi Sonal,


          Please find the attached file.

          Security level error.docx


          Regards,

          Uday Bhaskar

        3. Sonal Otwani

          Hi Uday Bhaskar ,

          I think you provided wrong file. Because it contains different error than which you provided (smile) 
          And the main purpose for asking this is, we need Payload which will be at the end in copied data.


          Can you please re-send the file again?


          Thanks,

          Sonal

        4. Uday Bhaskar

          Hi Sonal,


          I have reproduced the same error, Please find the attached error file.

          Security level.docx


          Regards,

          Uday Bhaskar


        5. Sonal Otwani

          Hi Uday Bhaskar ,

          Unfortunately, I am not able to find what i wanted. 

          Can we schedule a small call to resolve this?

          Kindly share your multiple available slots for this week with time zone.


          Thanks,

          Sonal 

        6. Uday Bhaskar

          Hi Sonal,


          I will be available from 3pm to 6.30pm IST today and tomorrow (2.30 pm to 6pm IST), Friday(2.30 pm to 6pm IST) . Schedule the call sometime between this based on your availability.


          Regards,

          Uday Bhaskar

        7. Uday Bhaskar

          Hi Sonal,


          Can you please update on the above.


          Regards,

          Uday Bhaskar

        8. Sonal Otwani

          Hi Uday Bhaskar ,

          Sorry for not providing you the update. We can do at 3:30 pm.

          Thanks,

          Sonal

        9. Uday Bhaskar

          Hi Sonal,


          Please schedule at 3.30pm in IST timings.


          Regards,

          Uday Bhaskar

        10. Sonal Otwani

          I hope you received following meeting invite:
          To join the video meeting, click this link: https://meet.google.com/wnp-kxki-tos
          Otherwise, to join by phone, dial +1 413-341-4719 and enter this PIN: 214 051 240#
          To view more phone numbers, click this link: https://tel.meet/wnp-kxki-tos?hs=5


          Thanks,

          Sonal 

        11. Sonal Otwani

          HI Uday Bhaskar 


          I confirmed that Security level can not be set in Jira Cloud by Exalate Out of the Box. It is possible in Jira On-premise.


          Let me know in case of any other concerns. 


          Thanks,

          Sonal

        12. Uday Bhaskar

          Hi Sonal,


          We have created dummy custom field with cloud security levels as dropdown in DC end . Is it possible to sync that custom field to security level in cloud end.


          Regards,

          Uday Bhaskar

        13. Uday Bhaskar

          Hi Sonal,


          Please provide an update.


          Regards,

          Uday Bhaskar

        14. Sonal Otwani

          Hi Uday Bhaskar ,

          But setting security level in Jira Cloud is not possible. Means Setting security level in Incoming sync script at Jira cloud is not possible by exalate.

          Thanks,

          Sonal

        CommentAdd your comment...
      2.  
        1
        0
        -1

        Hi Sonal,


        We have created a security level (select list(single choice) field in Jira Data center side and trying to sync this field to cloud to set automatically security level for issue keys .

        And also Please confirm how to set default security level in cloud end.

        Outgoing

        replica.securityLevel = issue.customFields"18736"


        Incoming

        issue.securityLevel = replica.securityLevel


        Regards,

        Uday Bhaskar

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi Uday Bhaskar ,

          Can you please share the script which you used for setting security level?

          Thanks,

          Sonal

            CommentAdd your comment...