[SOLVED] GetWorkItem in a document workflow context

Description
SteffPoint
Posts: 62
Joined: Wed Mar 07, 2018 1:06 pm

[SOLVED] GetWorkItem in a document workflow context

Postby SteffPoint » Thu Jan 31, 2019 3:13 pm

Hey guys,

is it possible to retrieve a custom field from a certain Work Item in a document workflow context?

Maybe something like this:

Code: Select all

var workitemfield = workflowContext.getTarget().getWorkItem("id?").getCustomField("fieldID");


getTarget() delivers the module as my script is triggered in a document workflow context.
Last edited by SteffPoint on Mon Feb 04, 2019 7:25 am, edited 2 times in total.

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

Re: GetWorkItem in a document workflow context

Postby ahh » Thu Jan 31, 2019 7:10 pm

Can I ask what you mean by getting a document custom field from a work item?

Other than that, I think your example should work fine. Take a look at the getWorkItem() method for IModule.

SteffPoint
Posts: 62
Joined: Wed Mar 07, 2018 1:06 pm

Re: GetWorkItem in a document workflow context

Postby SteffPoint » Fri Feb 01, 2019 1:18 pm

Oh, my bad :) The first "document" is wrong there. I updated my question.

And you were right, it does work with the Code I have posted 8)

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

Re: GetWorkItem in a document workflow context

Postby ahh » Fri Feb 01, 2019 11:17 pm

Gotcha :)

In that case I think your example code would work fine, assuming you know the id of the work item you want.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 5 guests