Home General Discussion

Create a WorkItem using the API

Hi Team!, we are trying to create a WorkItem using the API. We created the projection using CreateProjectionByTemplate,

and then passed it to Commit. WorkItem has been created, but we want to add relationship for it to request offering.

Is it possible to create a WorkItem right away with a specific relationship using Commit?

What is needed for this and how can we do this?

Answers

  • Peter_MiklianPeter_Miklian Customer Advanced IT Monkey ✭✭✭
  • Roman_NepomniashchiiRoman_Nepomniashchii Customer IT Monkey ✭

    I know how to create SR using these API. But SR is created without relationship with Request Offering. I need to attach Request Offering to SR during creation or after creation.

  • john_doylejohn_doyle Cireson Support Ninja IT Monkey ✭✭✭✭

    Hi @Roman_Nepomniashchii

    I replied to the ticket you opened on our system, but for the benefit of everyone in the community, I will reply here also. The Commit API creates the relationships between objects by loading them as objects and then creating the relationship. This works fine for most objects, but not for Request Offerings. The RO class derives from the System.Extension class in SCSM. Objects of classes derived from that class cannot be represented as Enterprise Management Objects. The only way to create relationships between work items and objects of this class is to create an Object Projection containing the relationship and commit that. This is how the portal creates the relationship between the RO and the work items created through the Service Catalog.

Sign In or Register to comment.