UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.
Absent Member.
1517 views

Get shared change request in target view

Jump to solution

If a  change request is shared from one view to another, is there any method to get all change requests history on specified view?

I try to use view id, but result is wrong. Code is in below:

ViewMemberCollection history = cr.getHistory();
for (int i = 0;i < history.size();i++) {
ChangeRequest t = (ChangeRequest) history.get(i);
if (view.getViewID() == t.getView().getViewID()){
System.out.println(t.getRevisionNumber() +" " + t.getDotNotation().toString());
}
}

//result 

4 1.3.1.4
3 1.3.1.3
2 1.3.1.2
1 1.3.1.1
0 1.3.1.0
3 1.3
2 1.2
1 1.1
0 1.0

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

I see. I think you want the value of the view property for the historical CRs, which is not the same as cr.getView(). cr.getView() always returns the view from which the history was queried.

instead of ...

>>if (view.getViewID() == t.getView().getViewID()){

try this...

Property viewProperty = t.getType().getProperties().find(TypedResource.Type.ViewProperty.NAME);

if (view.getViewID() == ((View)t.getValue(viewProperty)).getID())

  ...

View solution in original post

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

i think what you want is to get the shared change request in the 'other' view.

for that, look for the change request in the other view that has the same rootObjectID as 'this' original change request.

you can then query each share independently for its history.

0 Likes
Absent Member.
Absent Member.

What expect here is to get change request history only on specified view using known View object and history collection.

The result is like below:

4 1.3.1.4

3 1.3.1.3

2 1.3.1.2

1 1.3.1.1

0 1.3.1.0

0 Likes
Micro Focus Expert
Micro Focus Expert

I see. I think you want the value of the view property for the historical CRs, which is not the same as cr.getView(). cr.getView() always returns the view from which the history was queried.

instead of ...

>>if (view.getViewID() == t.getView().getViewID()){

try this...

Property viewProperty = t.getType().getProperties().find(TypedResource.Type.ViewProperty.NAME);

if (view.getViewID() == ((View)t.getValue(viewProperty)).getID())

  ...

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.