[midPoint] Trigger work item through REST API

Eetu Salpaharju Eetu.Salpaharju at tietokeskus.fi
Fri Sep 1 11:19:08 CEST 2023


Hello Midpoint community,

I try to automate some actions on Midpoint through REST API. My idea is fetch open manual cases through API. This works fine and API returns related work items in response data as shown below:

---- CLIP ---
<t:object xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="apti:ObjectListType">
    <apti:object oid="27c76c62-73fe-4c49-87eb-eef621706985" version="1" xsi:type="c:CaseType">
        <name>
            <t:orig>
                Request to delete 'Jane Doe' on 'System 123 (manual)'
            </t:orig>
            <t:norm>
                request to delete jane doe on workday adaptive planning manual
            </t:norm>
            <t:translation>
                <t:key>
                    ManualConnectorInstance.caseName
                </t:key>
                <t:argument>
                    <t:translation>
                        <t:key>
                            ManualConnectorInstance.operation.delete
                        </t:key>
                    </t:translation>
                </t:argument>
                <t:argument>
                    <t:value>
                        Jane Doe
                    </t:value>
                </t:argument>
                <t:argument>
                    <t:value>
                        System 123 (manual)
                    </t:value>
                </t:argument>
            </t:translation>
        </name>
        <metadata>
            <createTimestamp>
                2023-08-12T19:11:14.448+03:00
            </createTimestamp>
        </metadata>
        <assignment id="1">
            <targetRef oid="00000000-0000-0000-0000-000000000340" relation="org:default" type="c:ArchetypeType"/>
        </assignment>
        <archetypeRef oid="00000000-0000-0000-0000-000000000340" relation="org:default" type="c:ArchetypeType"/>
        <objectRef oid="0ec29f6d-c84e-465b-bc05-e2434d3ace44" relation="org:default" type="c:ResourceType"/>
        <targetRef oid="282ebf37-17b6-4e7a-83f8-7929666ccf35" relation="org:default" type="c:ShadowType"/>
        <requestorRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType"/>
        <state>
            open
        </state>
        <workItem id="2">
            <name>
                Request to delete 'Jane Doe' on 'System 123 (manual)'
            </name>
            <createTimestamp>
                2023-08-12T19:11:14.471+03:00
            </createTimestamp>
            <originalAssigneeRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType"/>
            <assigneeRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType"/>
        </workItem>
        <manualProvisioningContext>
            <pendingOperation>
                <type>
                    manual
                </type>
                <delta>
                    <t:changeType>
                        delete
                    </t:changeType>
                    <t:objectType>
                        c:ShadowType
                    </t:objectType>
                    <t:oid>
                        282ebf37-17b6-4e7a-83f8-7929666ccf35
                    </t:oid>
                    <t:itemDelta>
                        <t:modificationType>
                            delete
                        </t:modificationType>
                        <t:path>
                            kind
                        </t:path>
                    </t:itemDelta>
                </delta>
            </pendingOperation>
        </manualProvisioningContext>
        <stageNumber>
            1
        </stageNumber>
    </apti:object>
</t:object>
--- CLAP ---

I'd need to trigger similar action through API what happens when a user clicks "Done successfully" on the work item in UI?


Thank you for your feedback in advance.


BEST REGARDS

Eetu Salpaharju
Tietokeskus Finland Oy
 


More information about the midPoint mailing list