Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-6252

Service Desk automation rules are not triggering in Service Desk 4.0.1 when connecting to a MS-SQL database

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Highest Highest
    • 4.0.2
    • 4.0.2
    • Automation

      Issue description

      Service Desk automation rules are no longer triggered in Service Desk 4.0.1 when connecting to a MS SQL database.

      Steps to reproduce

      1. Install a fresh JSD 4.0.1 instance
      2. Connect it to a MS SQL database by following the instructions in Connecting JIRA to MS SQL 2014
      3. Create a new Service Desk project
      4. Create a new SD ticket
      5. Add a few comments to the SD ticket to try to trigger the default automation "Transition on comment"

      Expected Result

      • The transition from the default automation "Transition on comment" should be triggered
      • There should be some information in the log page of the automation "Transition on comment" whenever a new comment is added to the ticket (whether the automation was successful or not)

      Actual Result

      • The transition is not happening at all
      • The log page of the automation "Transition on comment" is completely empty

      Workaround

      If you are using JIRA with JAVA 8

      1. Stop JIRA
      2. Move the MS SQL driver mssql-jdbc-7.2.0.jre8.jar from the folder below (please make a backup of it or move it to a temporary folder)
        <JIRA_INSTALLATION_FOLDER>/lib
        
      3. Copy the driver mssql-jdbc-6.2.1.jre8.jar to the same folder
      4. Start JIRA

      If you are using JIRA with Java 11

      Please note that we do not have a fully tested workaround for JIRA running with Java 11 and involving the replacement of the ms sql jdbc driver.

      For this reason, as a workaround, what you can do is either downgrade to your previous version or 4.0.0 of Service Desk, which are both unaffected by this problem. Here are the steps you can follow to execute a downgrade. 8.0.0 might be your best bet since it's a closer down version to what you are on:

      1. Download the Jira ServiceDesk 4.0.0 Server installer from the link below to install Jira Core 8.0.0 + Service Desk 4.0.0: Update Jira Service Desk Server. You will want to click on View all versions to get to the 4.0.0 installer for Windows.
      2. Install Jira Service Desk Server 4.0.0 as a new separate standalone instance as a medium for the 'downgrade'. That being said, there should be a new JIRA_Home, JIRA_Installation, and new database for this Service Desk 4.0.0 instance on a new server.
      3. Once this new instance (4.0.0) is ready, shut it down.
      4. Allocate adequate application memory as per the Jira Sizing Guide and set the flag -Djira.downgrade.allowed=true on the JSD 4.0.0 instance as per our Setting properties and options on startup documentation for your new Windows instance. This is to allow the downgrade to run properly.
      5. Start the new 4.0.0 instance of Service Desk.
      6. Take a latest XML backup from your 4.0.1 Service Desk instance that you currently have that is encountering these issues.
      7. Restore the backup into the new 4.0.0 instance. There will be a message that needs to be acknowledged on the UI after selecting the backup for restoration. Acknowledge it, verify the correct backup file has been chosen and then click on the Restore button again to kick start the restoration process.
      8. Once this is done, your user will be logged out. Re-login to the 4.0.0 instance, ensure the JSD application is installed and licensed, and that you are able to run automation and send out notifications to customers on some test issues.

      Important Note

      Other Service Desk functionalities are also impacted in Service Desk 4.0.1, when running with a MS SQL Database:

      • SLA panel is empty when new issues are created and SLA does not stop/pause, when using MS SQL with JSD 4.0.1
      • Customer notifications are no longer created and sent when using MS SQL with JSD 4.0.1

        1. Autmation_Bug_Step1.png
          Autmation_Bug_Step1.png
          100 kB
        2. Autmation_Bug_Step2.png
          Autmation_Bug_Step2.png
          72 kB
        3. mssql-jdbc-6.2.1.jre8.jar
          774 kB

          Form Name

            [JSDSERVER-6252] Service Desk automation rules are not triggering in Service Desk 4.0.1 when connecting to a MS-SQL database

            I have the same bug as @jeff but im using oracle as a database. Any suggestion?

            Thanks!

            Josep Maria Cao added a comment - I have the same bug as @jeff but im using oracle as a database. Any suggestion? Thanks!

            Дмитрий added a comment - - edited

            ashubovych, Thanks for paying attention to our problem, the new ticket will be considered for a very long time. Part of our automation is webhooks, plus two problems overlapping (driver and webbook), and we got quite a long idle time. Therefore wrote here in the hope of a more faster solution.

            Checked, in MS whole DB have SQL_Latin1_General_CP437_CI_AI and AO_9B2E3B_ same collation.

            Yes, first of all I tried to add a manual header Character-Encoding: UTF-8 it not help. Try to add manual header Content-Type: application/json; charset=UTF-8 , but system Content-type: application/json cann't be overwritten and remains the same.

            I have enough experience, and I understand what the encoding problem is, but all attempts to open the received data in various iconv have not been successful. It feels like the data is not correctly encoded before sending, all data not in special characters like �����, they a in real question marks ?????

            For example, if I open received json data in Chrome

            Core 8.0 SD 4.0
            'summary' => 'Переименовать телефон (VPN)' 'summary' => '????????????? ??????? (VPN)',

             I checked it on a clear install, the problem also occurs.

            Дмитрий added a comment - - edited ashubovych , Thanks for paying attention to our problem, the new ticket will be considered for a very long time. Part of our automation is webhooks, plus two problems overlapping (driver and webbook), and we got quite a long idle time. Therefore wrote here in the hope of a more faster solution. Checked, in MS whole DB have  SQL_Latin1_General_CP437_CI_AI and  AO_9B2E3B_ same collation. Yes, first of all I tried to add a manual header  Character-Encoding: UTF-8 it not help. Try to add manual header  Content-Type: application/json; charset=UTF-8  , but system  Content-type: application/json cann't be overwritten and remains the same. I have enough experience, and I understand what the encoding problem is, but all attempts to open the received data in various iconv have not been successful. It feels like the data is not correctly encoded before sending, all data not in special characters like �����, they a in real question marks ????? For example, if I open received json data in Chrome Core 8.0 SD 4.0 'summary' => 'Переименовать телефон (VPN)' 'summary' => '????????????? ??????? (VPN)',  I checked it on a clear install, the problem also occurs.

            deyura this is not really related to this ticket, since it is all about automation rules on JSD 4.0.1 and MSSQL 2014. You could start a new one or hop on the existing ticket (given one exists already).

            But just to be sure: can you check the collation for the JSD automation tables in your database? Those are the ones starting with AO_9B2E3B_. Also, I have noticed that the content-type in Jira Core request contains the charset part. I am not sure how that request is being sent, but let's try adding the charset=UTF-8 part (if that could be configured from UI).

            moofoo (Inactive) added a comment - deyura this is not really related to this ticket, since it is all about automation rules on JSD 4.0.1 and MSSQL 2014. You could start a new one or hop on the existing ticket (given one exists already). But just to be sure: can you check the collation for the JSD automation tables in your database? Those are the ones starting with AO_9B2E3B_ . Also, I have noticed that the content-type in Jira Core request contains the charset part. I am not sure how that request is being sent, but let's try adding the charset=UTF-8 part (if that could be configured from UI).

            jrey

            Checked on version 4.0.0 + MS 13.0.1601, the bug does not show up and everything works correctly. But in both versions SD 4.0.0/1 we have error encoding UTF-8 when SD send webhook.

            Problem only is SD, in Core (system webhooks config), all work fine. Different presents in header charset=UTF-8

            Core 8.0.0/1

             

             'description' => 'У вас новый телефон? Подпишите его своим именем'

             

             

            'Accept' => '*/*',
            'Content-Type' => 'application/json; charset=UTF-8',
            'Via' => '1.1 localhost (Apache-HttpClient/4.5.5 (cache))',
            'Content-Length' => '10414',
            'Connection' => 'Keep-Alive',
            'User-Agent' => 'Atlassian HttpClient 2.0.0 / JIRA-8.0.1 (800009) / Default',
            

            SD 4.0.0/1

            'description' => '? ??? ????? ???????? ????????? ??? ????? ??????'
            

             

            'User-agent' => 'JIRA-Service-Desk-4.0.1 / Apache-HttpClient',
            'Accept' => 'application/json',
            'Content-type' => 'application/json',
            'Content-Length' => '12141',
            'Connection' => 'Keep-Alive',
            'Accept-Encoding' => 'gzip,deflate',
            

            Дмитрий added a comment - jrey ,  Checked on version 4.0.0 + MS 13.0.1601 , the bug does not show up and everything works correctly. But in both versions SD 4.0.0/1 we have error encoding UTF-8 when SD send webhook. Problem only is SD, in Core (system webhooks config), all work fine. Different presents in header charset=UTF-8 Core 8.0.0/1     'description' => 'У вас новый телефон? Подпишите его своим именем'     'Accept' => '*/*' , 'Content-Type' => 'application/json; charset=UTF-8' , 'Via' => '1.1 localhost (Apache-HttpClient/4.5.5 (cache))' , 'Content-Length' => '10414' , 'Connection' => 'Keep-Alive' , 'User-Agent' => 'Atlassian HttpClient 2.0.0 / JIRA-8.0.1 (800009) / Default' , SD 4.0.0/1 'description' => '? ??? ????? ???????? ????????? ??? ????? ??????'   'User-agent' => 'JIRA-Service-Desk-4.0.1 / Apache-HttpClient' , 'Accept' => 'application/json' , 'Content-type' => 'application/json' , 'Content-Length' => '12141' , 'Connection' => 'Keep-Alive' , 'Accept-Encoding' => 'gzip,deflate' ,

            I've also done the second workaround and the automation rules are triggering now.   It might be nice if you could attach mssql-jdbc-6.2.1.jre8.jar to this bug so that other folks don't have to run through the whole 4.0.0 on another server just to get that file...

            Nathan Vanderhoof added a comment - I've also done the second workaround and the automation rules are triggering now.   It might be nice if you could attach mssql-jdbc-6.2.1.jre8.jar to this bug so that other folks don't have to run through the whole 4.0.0 on another server just to get that file...

            Hi @Julien Rey,

             

            I did the second workaround suggested by you, which I found easier to do, and the automations as well as the SLAs started working again!

             

            Thanks for your help!

            Jeff Santos added a comment - Hi @Julien Rey,   I did the second workaround suggested by you, which I found easier to do, and the automations as well as the SLAs started working again!   Thanks for your help!

            This worked as workaround for us.

            Another workaround is to modify the MS SQL library which is shipped with Service Desk 4.0.1, and which is causing all these bugs

            1. Stop JIRA
            2. Move the MS SQL driver mssql-jdbc-7.2.0.jre8.jar from the folder below (please make a backup of it or move it to a temporary folder)
              <JIRA_INSTALLATION_FOLDER>/lib
              
            1. Copy the driver mssql-jdbc-6.2.1.jre8.jar to the same folder (you can find this driver by downloading the JIRA Service Desk server version 4.0.0 from this link and clicking on "All Server versions" to select 4.0.0)
            2. Start JIRA

            Patrik Ytterström added a comment - This worked as workaround for us. Another workaround is to modify the MS SQL library which is shipped with Service Desk 4.0.1, and which is causing all these bugs Stop JIRA Move the MS SQL driver mssql-jdbc-7.2.0.jre8.jar from the folder below (please make a backup of it or move it to a temporary folder) <JIRA_INSTALLATION_FOLDER>/lib Copy the driver mssql-jdbc-6.2.1.jre8.jar to the same folder (you can find this driver by downloading the JIRA Service Desk server version 4.0.0 from  this link  and clicking on "All Server versions" to select 4.0.0) Start JIRA

            jrey

            thank you very much, the replacement mssql-jdbc-6.2.1.jre8.jar helped.

            about 8.0.0, if you do not confirm, I need more time to investigation. Because on Production we have MS 11.0.2160, and it work normally. The trouble was on Development server where MS is 13.0.1601.

            Can you help with webhook https://jira.atlassian.com/browse/JSDSERVER-6250, I check headers, when SD send webhook there no UTF-8 encoding. Try add it manually in header - it not help. It feels like the data is not correctly encoded before sending.

            Дмитрий added a comment - jrey ,  thank you very much, the replacement mssql-jdbc-6.2.1.jre8.jar helped. about 8.0.0, if you do not confirm, I need more time to investigation. Because on Production we have MS 11.0.2160, and it work normally. The trouble was on Development server where MS is 13.0.1601. Can you help with webhook https://jira.atlassian.com/browse/JSDSERVER-6250 , I check headers, when SD send webhook there no UTF-8 encoding. Try add it manually in header - it not help. It feels like the data is not correctly encoded before sending.

            deyura

            We verified that this bug (and the other 2 bugs linked to this one) is not present in Service Desk 4.0.0, so I am wondering if you might be facing a different issue.

            Can you please reach out to Atlassian Support, so that we can investigate further?

             

            Julien Rey added a comment - deyura We verified that this bug (and the other 2 bugs linked to this one) is not present in Service Desk 4.0.0, so I am wondering if you might be facing a different issue. Can you please reach out to Atlassian Support , so that we can investigate further?  

            Julien Rey added a comment - - edited

            jefferson.santos,

            Other Service Desk functionalities are also impacted in Service Desk 4.0.1, when running with a MS SQL Database, including:

            • SLA panel is empty when new issues are created and SLA does not stop/pause, when using MS SQL with JSD 4.0.1
            • Customer notifications are no longer created and sent when using MS SQL with JSD 4.0.1

            Therefore the issue that you are facing is expected as well, due to the bug.

            There are 2 workarounds:

            Workaround consisting in modifying the MS SQL library which is shipped with Service Desk 4.0.1, and which is causing all these bugs

            1. Stop JIRA
            2. Move the MS SQL driver mssql-jdbc-7.2.0.jre8.jar from the folder below (please make a backup of it or move it to a temporary folder)
              <JIRA_INSTALLATION_FOLDER>/lib
              
            3. Copy the driver mssql-jdbc-6.2.1.jre8.jar to the same folder
            4. Start JIRA

            Workaround which consists in downgrading Service Desk

            You can either downgrade to your previous version or 4.0.0 of Service Desk, which are both unaffected by this problem. Here are the steps you can follow to execute a downgrade. 8.0 might be your best bet since it's a closer down version to what you are on:

            1. Download the Jira ServiceDesk 4.0.0 Server installer from the link below to install Jira Core 8.0.0 + Service Desk 4.0.0: Update Jira Service Desk Server. You will want to click on View all versions to get to the 4.0.0 installer for Windows.
            2. Install Jira Service Desk Server 4.0.0 as a new separate standalone instance as a medium for the 'downgrade'. That being said, there should be a new JIRA_Home, JIRA_Installation, and new database for this Service Desk 4.0.0 instance on a new server.
            3. Once this new instance (4.0.0) is ready, shut it down.
            4. Allocate adequate application memory as per the Jira Sizing Guide and set the flag -Djira.downgrade.allowed=true on the JSD 4.0.0 instance as per our Setting properties and options on startup documentation for your new Windows instance. This is to allow the downgrade to run properly.
            5. Start the new 4.0.0 instance of Service Desk.
            6. Take a latest XML backup from your 4.0.1 Service Desk instance that you currently have that is encountering these issues.
            7. Restore the backup into the new 4.0.0 instance. There will be a message that needs to be acknowledged on the UI after selecting the backup for restoration. Acknowledge it, verify the correct backup file has been chosen and then click on the Restore button again to kick start the restoration process.
            8. Once this is done, your user will be logged out. Re-login to the 4.0.0 instance, ensure the JSD application is installed and licensed, and that you are able to run automation and send out notifications to customers on some test issues.

            Julien Rey added a comment - - edited jefferson.santos , Other Service Desk functionalities are also impacted in Service Desk 4.0.1, when running with a MS SQL Database, including: SLA panel is empty when new issues are created and SLA does not stop/pause, when using MS SQL with JSD 4.0.1 Customer notifications are no longer created and sent when using MS SQL with JSD 4.0.1 Therefore the issue that you are facing is expected as well, due to the bug. There are 2 workarounds: Workaround consisting in modifying the MS SQL library which is shipped with Service Desk 4.0.1, and which is causing all these bugs Stop JIRA Move the MS SQL driver mssql-jdbc-7.2.0.jre8.jar from the folder below (please make a backup of it or move it to a temporary folder) <JIRA_INSTALLATION_FOLDER>/lib Copy the driver mssql-jdbc-6.2.1.jre8.jar to the same folder Start JIRA Workaround which consists in downgrading Service Desk You can either downgrade to your previous version or 4.0.0 of Service Desk, which are both unaffected by this problem. Here are the steps you can follow to execute a downgrade. 8.0 might be your best bet since it's a closer down version to what you are on: Download the Jira ServiceDesk 4.0.0 Server installer from the link below to install Jira Core 8.0.0 + Service Desk 4.0.0: Update Jira Service Desk Server . You will want to click on View all versions to get to the 4.0.0 installer for Windows. Install Jira Service Desk Server 4.0.0 as a new separate standalone instance as a medium for the 'downgrade'. That being said, there should be a new JIRA_Home , JIRA_Installation , and new database for this Service Desk 4.0.0 instance on a new server. Once this new instance (4.0.0) is ready, shut it down. Allocate adequate application memory as per the Jira Sizing Guide and set the flag -Djira.downgrade.allowed=true on the JSD 4.0.0 instance as per our Setting properties and options on startup documentation for your new Windows instance. This is to allow the downgrade to run properly. Start the new 4.0.0 instance of Service Desk. Take a latest XML backup from your 4.0.1 Service Desk instance that you currently have that is encountering these issues. Restore the backup into the new 4.0.0 instance. There will be a message that needs to be acknowledged on the UI after selecting the backup for restoration. Acknowledge it, verify the correct backup file has been chosen and then click on the Restore button again to kick start the restoration process. Once this is done, your user will be logged out. Re-login to the 4.0.0 instance, ensure the JSD application is installed and licensed, and that you are able to run automation and send out notifications to customers on some test issues.

              ashubovych moofoo (Inactive)
              jrey Julien Rey
              Affected customers:
              15 This affects my team
              Watchers:
              19 Start watching this issue

                Created:
                Updated:
                Resolved: