none
Problem with CheckIn project using Project Server 2013 REST API

    Pertanyaan

  • Hello,

    I'm trying to check in the project.

    The algorithm is: - POST CheckIn request - receive QueueJob;    -- if completed - done   -- if not completed (processing)        - wait        - GET Projects('GUID')/QueueJob('GUID')          -- if completed - done          -- if not completed - goto wait 1. POST call to http(s)//myProjectServer/PWA/_api/ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/Draft/CheckIn('false') 2. Getting back the QueueJob:

    <entry xml:base="http://vmw4755:8080/PWA/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:ns2="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:ns3="http://schemas.microsoft.com/ado/2007/08/dataservices">

    <id>http://myProjectServer/PWA/_api/ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs('9fbfdb67-07b7-e811-9b41-005056a207f2')</id>

        <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="PS.QueueJob"/>

        <link href="ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs('9fbfdb67-07b7-e811-9b41-005056a207f2')" rel="edit"/>

        <link href="ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs('9fbfdb67-07b7-e811-9b41-005056a207f2')/Project" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Project" title="Project"

            type="application/atom+xml;type=entry"/>

        <link href="ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs('9fbfdb67-07b7-e811-9b41-005056a207f2')/Submitter" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Submitter" title="Submitter"

            type="application/atom+xml;type=entry"/>

        <title/>

        <updated>2018-09-13T03:45:09Z</updated>

        <author>

            <name/>

        </author>

        <content type="application/xml">

            <ns2:properties>

                <ns3:Id ns2:type="Edm.Guid">9fbfdb67-07b7-e811-9b41-005056a207f2</ns3:Id>

                <ns3:JobState ns2:type="Edm.Int32">3</ns3:JobState>

                <ns3:MessageType ns2:type="Edm.Int32">21</ns3:MessageType>

                <ns3:PercentComplete ns2:type="Edm.Int32">37</ns3:PercentComplete>

                <ns3:WaitMilliseconds ns2:type="Edm.Int32">1000</ns3:WaitMilliseconds>

                <ns3:WaitTime ns2:type="Edm.Time">PT1S</ns3:WaitTime>

            </ns2:properties>

        </content>

    </entry>

    All the good stuff is there: JobState - Processing, MessageType - checking in, wait - 1 sec. 3. waiting for 1 sec (sleep(1000)) 4. GET using the link: http://myProjectServer/PWA/_api/ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs('9fbfdb67-07b7-e811-9b41-005056a207f2')

    I would expect getting back updated QueueJob, but instead getting this:

    <?xml version="1.0" encoding="utf-8"?>

    <d:GetById xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:null="true" />

     

    Next, tried just to get all of the QueueJobs: GET using the link: http://myProjectServer/PWA/_api/ProjectServer/Projects('e140492f-d742-4a2f-88c3-3fe30edf16c1')/QueueJobs (tried within the code and just directly from the browser - same result)

    <?xml version="1.0" encoding="utf-8"?>

    <feed xml:base="http://vmw4755:8080/PWA/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">

        <id>5ed485e5-6ac1-4cf0-99d1-cb14e7637532</id>

        <title />

        <updated>2018-09-13T05:30:19Z</updated>

        <author>

            <name />

        </author>

    </feed>

    Do not see any jobs, but at least CheckIn should be there? Right?

    Opened the PWA, went to Server Settings and I can see the job there:
    9fbfdb67-07b7-e811-9b41-005056a207f2 N/A 9/13/2018 5:45 AM 9/13/2018 5:45 AM E-9990 Project Checkin Success 100%

    What am I doing wrong?

    How can I get the all QueueJobs?

    I'm using Project 2013 and Java-based client.

    HELP!

    Thanks.

    Kamis, 13 September 2018 13.55

Semua Balasan

  • Hi Jaroma,

    Try the below to checkin the Project using REST.

    # ReST request to publish and check-in the project
    Post-ReSTRequest $SiteUrl "ProjectServer/Projects('$projectid')/Draft/publish(true)" $null


    Jumat, 14 September 2018 04.52
  • POST Publish(true/false) still queued request, so if the call is not complete immediately, the returned QueueJob will have percent complete and wait time (if status is processing), the GET call to Projects('projectid')/QueueJobs('jobId') should bring the updated status, correct? So when status is 4 (completed), than I can be certain that the checkIn (or whatever queued job) completed successfully.

    In case the code returned is OnHold, ReadyToProcess, etc., it is even more important to see the status.

    I can see the jobs in PWA Server Setting interface, why I cannot get the same list using REST call? It was working with the SOAP PSI, must it work with the REST too?

    Jumat, 14 September 2018 14.24