8 Replies Latest reply on Mar 8, 2017 12:24 AM by SunilKr

    Preventing date update with content update rest call

    anuj.pathak

      We are trying to bulk move content using Jive REST API for content /api/core/v3/contents/{content id}  but I noticed this call also updating (1) Thread last reply on date as well as (2)updated by person name. it also pushes content into (3)recent activity or content start appearing on top of space recent content after move.

       

       

      Does anyone know how we can prevent these with REST content move call?

       

      By passing additional query parameter "minor=true" with REST call helps me with (2) but not with issue (1) & (3).

      We are on jive hosted version 8.0.4.

       

      Thanks.

        • Re: Preventing date update with content update rest call
          mcollinge

          You could backdate the update by passing in this parameter;

           

          • Re: Preventing date update with content update rest call
            SunilKr

            Hi Anuj Pathak, I facing the issue (2) updated by person name but scenario is bulk move content I am also passing the parameter "minor=true" and it work for some of the document but some document get update the "last modified by" user name who moving the content. --- via custom code

            But if the similar document is moved by using Jive OOTB "Move" action then it does not change the "last modified by" attribute. The author name remain show in "last modified by" attribute.

             

            How can we stop updating the "last modified by" attribute while content update? Also do you know the filed name which stores the value of it in which Jive table?

             

            cc: Ryan Rutan

              • Re: Preventing date update with content update rest call
                anuj.pathak

                I am not sure about issue you are facing with minor=true param, maybe it is not working as expected for all content types. There is no way (API) to move content without facing issue mentioned in my post. if you are on Jive 9 (or cloud prior version), you can take advantage of front end bulk move content functionality but API move does impact modification date and last updated by fields.

                 

                If you are planning to switch to database approach. here is some example to bulk move different content from one space to another , you can change/add more conditions as you need.

                 

                UPDATE jivequestion SET containerID=XYZ WHERE containertype=14 AND containerID IN (XYZ1, XYZ2);

                UPDATE jiveanswer SET containerID=XYZ WHERE containertype=14 AND containerID IN (XYZ1, XYZ2);

                UPDATE jivemessage SET containerID=XYZ WHERE containertype=14 AND containerID IN (XYZ1, XYZ2);

                UPDATE jivethread SET containerID=XYZ WHERE containertype=14 AND containerID IN (XYZ1, XYZ2);

                UPDATE jivedocument SET containerid=XYZ WHERE containertype=14 AND containerid IN (XYZ1);

              • Re: Preventing date update with content update rest call
                SunilKr

                Hi Pawan Shah, I am getting this issue in app that you developed for bulk move content  https://community.jivesoftware.com/community/developer/blog/2014/09/05/add-on-to-move-content-between-places-in-bulk

                The app working fine and very useful but the only issue is "last modified by" attribute update for moved content. Even passing parameter {"minor": "true"} not restrict to update "last modified by" attribute.

                 

                Here is the code

                 

                1. var moveContent = function(targetGroupId){ 
                2.     var contentIds = getIdsForSelectedContent(); 
                3.  
                4.         for (var i in contentIds){ 
                5.             content_url = opensocial.getEnvironment()['jiveUrl']+"/api/core/v3/contents/"+contentIds[i] 
                6.             osapi.jive.corev3.contents.get({"uri":content_url}).execute(function(data){ 
                7.                 data.parent = opensocial.getEnvironment()['jiveUrl']+"/api/core/v3/places/"+$("#toGroup").attr("data-groupid"); 
                8.                 data.update().execute(function (data) { 
                9.                     if(i == (contentIds.length-1)){ 
                10.                         displaySuccessMessage("Successfully Moved the content"); 
                11.                         refreshContentList(); 
                12.                     } 
                13.                 }); 
                14.             }) 
                15.         } 
                16. }; 

                 

                Can you please suggest how to prevent "last modified by" attribute update?

                 

                cc:Ryan Rutan

                 

                -Sunil

                • Re: Preventing date update with content update rest call
                  SunilKr

                  Thanks for your response !!!

                  We are on Jive 8 and hosted so database approach may not work here.

                  I am not facing issue with minor=true param but by passing this param, for some documents "last modified by" attribute remain show the owner name of content (-expected) but for some document  "last modified by" gets updated by user name who used that app "move content" bulk upload app.

                  And my requirement is not to change "last modified by"  attribute. So passing minor=true not working for all content and even I am trying to move the same contenttype= 14.

                   

                  Any other suggestion will be much appreciated.