How do i create new workitem using Polarion openAPI?

Description
hpatel51
Posts: 5
Joined: Wed Apr 25, 2018 9:27 am

How do i create new workitem using Polarion openAPI?

Postby hpatel51 » Thu Mar 07, 2019 8:32 am

I am creating one widget in Polarion using openAPI. I need to create various workitems using the same.

can anyone suggest how can i do this?

ahh
Posts: 9
Joined: Thu Jan 24, 2019 4:34 pm

Re: How do i create new workitem using Polarion openAPI?

Postby ahh » Fri Mar 08, 2019 8:53 pm

You'll probably want to start with the ITrackerService.createWorkItem method. Make sure to set the work item type of the new work item before saving it, otherwise you'll get a work item with an undefined type.

PatrickClaus
Posts: 19
Joined: Thu Jan 18, 2018 11:02 am
Location: Frauenauracher Str. 85, 91056 Erlangen

Re: How do i create new workitem using Polarion openAPI?

Postby PatrickClaus » Tue Mar 12, 2019 2:35 pm

As the above poster mentioned, have a look at:

https://almdemo.polarion.com/polarion/s ... rvice.html
and use the createWorkItem method.

Note that it specifically mentions that this Object is not persisted (yet).
You need to call:

$transactionService.beginTx()
$workitem.save()
$transactionService.commitTx()

to actually make this WorkItem persistent within your project.
See: https://almdemo.polarion.com/polarion/s ... rvice.html

Also think about a $transactionService.rollbackTx() in case the try-catch block that should be used to surround workitem.save() fires.
Best Regards,
Patrick Claus

External service provider at Valeo Siemens eAutomotive GmbH
Frauenauracher Str. 85
91056 Erlangen, Germany
Mail Address

hpatel51
Posts: 5
Joined: Wed Apr 25, 2018 9:27 am

Re: How do i create new workitem using Polarion Rendering API?

Postby hpatel51 » Mon Mar 25, 2019 10:05 am

Thanks @ahh and @Patrick.
Mentioned way works perfectly fine.

I am creating one widget using Rendering API, i have implemented every functionality using Rendering API only.

But, Only for 'create workItem' functionality i have to include WebServices API in my project.
Hence i was searching for a way to create workitem using Rendering API, then Open API and then Web Services API.

Apologies for providing limited info in the question.

ahh
Posts: 9
Joined: Thu Jan 24, 2019 4:34 pm

Re: How do i create new workitem using Polarion openAPI?

Postby ahh » Wed Mar 27, 2019 11:40 pm

The Rendering API is used mostly for rendering data (hence the name :D ). I do not really know what facilities it has for writing data to the repository. I'd recommend using the Open API for write transactions.

Also, I believe that Polarion prevents write transactions from the velocity context in Rich Pages.

riyarathi
Posts: 1
Joined: Wed Apr 17, 2019 9:12 am
Contact:

Re: How do i create new workitem using Polarion openAPI?

Postby riyarathi » Wed Apr 17, 2019 10:36 am

That was nice.great Thanks for sharing this great discussion :D


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Google [Bot] and 8 guests