IBM DOORS how to import rows from excel to specific place in DOORS - ibm-doors

I have some rows in DOORS identified by a number. For example
Object Identifier
Description
1
description of object 1
2
description of object 2
3
description of object 3
4
description of object 4
I know if I want to modify an existing object, I just import an excel that has the columns Object Identifier and Description with the same number in the Object Identifier column, as the object I want to modify.
If I want to create new objects, I import rows with empty Object Identifier column. They get the identifier assigned automatically and will be inserted in the bottom of the table in DOORS.
But I want to modify some existing objects and create a new object specifically under the second object.
Object Identifier
Description
1
modified description of object 1
2
description of object 2
5
new object
3
modified description of object 3
4
description of object 4
How can I do this in one import?

I'm not aware of an official support for this. One method could be to have an additional column called e.g. "below". In this column, the excel editor might enter the object number of the parent object.
Then, after you imported your excel to DOORS, you would run a code like this, which moves every object where "below" is set, below the referenced parent object
Object o
Module m = edit … (or current or whatever)
Skip sk = create
for o in m do {
put sk, o, o
}
for o in sk do {
int iBelow = intOf realOf (o."below""")
if (iBelow) {
move o, below object iBelow
o."below" = ""
}
}
save m

As far as I remember while screwing up a whole DOORS module, when you select to import (the excel file in a csv format), you can choose to update or create.
If you pick update, it will ask for the column with unique identifiers (usually, the object IDs column) and for the objects that doesn't have a number, they will be created, updating the ones that do have an ID, but (as you state in the question) the new ones will be added at the bottom.
Now, we are only using the ID attribute of the objects, which makes them unique even if is moved, deleted or flushed, but for the meaning of sorting, that attribute is meaningless, because if you copy an object (from the same module or from another) the ID updates to the next available according to the ones in the module.
The attribute that tells DOORS how to structure and sort the objects, is actually the Object Number
"... hierarchical ..." is the keyword here. That attribute tells DOORS the order of the objects and which is parent/children of which.
Now, I don't really remember if that attribute can be modified in the csv, but there are two DXL scripts that combined, enable that while importing:
\IBM\Rational\DOORS\X.Y\lib\dxl\example\oslc\ hierarchy.dxl
\IBM\Rational\DOORS\X.Y\lib\dxl\standard\import\ commas.dxl
Unfortunatelly, I couldn't find the combined script, but I know it uses those 2 (some time ago I was making the DXL to do almost the same as you want, but someone else at my work managed to do it first and with time, it was no longer necessary)
Here is the reference manual (image is from page 402/1006)
And this page has some good scripts, too.
I hope my answer helps you to build that script (or find some coworkers that do it before you do, hehe)

Related

How to reset Object Identifier (ID) attributes in IBM DOORS module

I'd like to reset (re-arrange) all the Object Identifiers (ID) in an IBM DOORS module. I inherited the original description and would like to update the ID tags to have a better flow in the document.
Inherited
ID
Content
Req-55
Content A
Req-57
Content B
Req-14
Content C
Wanted
ID
Content
Req-01
Content A
Req-02
Content B
Req-03
Content C
It's important to highlight that I'm fully aware that each ID is linked to a database. I just want to try to figure out a way to have the ID tag better organized.
You should never give the DOORS "Absolute Number" of DOORS Objects a meaning besides the numbers being unique. DOORS gives you next to no means(*) to manipulate that number to use it for sth like a "flow". If you want an identifying number that has any kind of semantic, you will have to create a new Attribute which contains a manually filled identifier. With this, the user is free to e.g. create Requirement numbers e.g. in steps of 10 so that he can later add intermediate numbers, like
Manual ID
Content
Req-010
Content A
Req-020
Content B
Req-025
Content B.1
Req-030
Content C
(*) Well, if you really really really want to rearrange the objects as a one-time action and cannot sleep any more otherwise, you can only create a completely new Module, e.g. using Spreadsheet Export / Import, but this will result in the loss of all Links (which you will have to recreate somehow), all historic information like e.g. baselines, all permissions, possibly content like OLE objects and more. Prepare for nightmares.

How to retrieve specific value from LIST using SELECT

I keep retrieving the entire LIST of Customer's Total Amount instead of the Specific Customer. I have tried using SELECT according to their Order ID to filter out other Customer. However, the result is still the whole list.
My code here
I have tried to FILTER using Customer Name and Order ID. However, the outcome is still the same, returning the entire LIST of Total Amount.
If you reference connect your line items to your order, app sheet will natively create a reverse reference on the order table that contains a list of all of the corresponding line items for that order.
The list that you're looking for lives in the data inside that column. To get the data out you need to do a list the reference, which will extract the value of whatever column you specify out of that reverse reference, creating a list of the values you want from those child records.
Then if you wanted to create a total for all of those line items, you could wrap that list dereference in sum().
References are the key to making just about everything advanced work inside app sheet, definitely worth wrapping your mind around.

Dxl view move objects

Can you move an entire object from one view to another (without deleting it in one view, load another view, create object in the new view and populate it ? If yes, can you tell me how or point me in the right direction? And also, how can i get the information from the last column, without needing to iterate though all the columns. Thanks.
Concerning the comment on using the second script in a DXL attribute:
DXL attributes do not work this way.
in a DXL attribute you would never have a loop over all objects, you only refer to a single object and you calculate a value for this object's attribute.
accept and reject work on views, DXL attributes have a content, these are different concepts.
If you want to use DXL attributes, you might have one of type boolean and use a script like
bool showMe=false
// in DXL Attributes, obj contains the currently evaluated object (not the "current" object!)
if intOf(obj."Absolute Number""") == 10 then showMe=true
if intOf(obj."Absolute Number""") > 20 then showMe=true
// the name of the DXL Attribute is stored automatically in the variable attrDXLName
obj.attrDXLName = showMe
and then you have a view with a filter that shows only these objects where the attribute's value is "true"
You need to be a bit more precise in your wording, it is unclear what you want.
In DOORS, a Module contains objects. The structure of the module determines which attributes each object has. Views are a, well, a view on these objects. A view determines which attributes of the object are shown, these are the columns shown in a view. Additionally, a view can have a filter, which determines which objects of the module are shown.
So, to answer your question, if one view of a module contains an object and another view of the same module does not show that object, you need to adopt the filter of the other view.
Your second question is about DXL, right? No, I do not know of a function that tells you the number of columns in a view, so that you can use the column (index) function to get the last column, but a small loop
Column cLast
for cLast in m do {}
// now cLast contains the last column of the current view
should not hurt. But are you sure that you really want to work with columns? Usually, scripts rather deal with attributes of objects, and only rarely with columns (the exception being dxl layout columns and of course scripts that manipulate views).
Update: to add to my comment about filters in views, there actually is a way of adding single objects to a view, i.e. the accept/reject method. You could have a script like
Object o
for o in entire current Module do {
reject o
if intOf(o."Absolute Number""") == 10 then accept o
if intOf(o."Absolute Number""") > 20 then accept o
if o."Requrement type""" == "Functional" then accept o
}
filtering on
but this addition will be very short-lived: as soon as you change the view, it forgets that sort of filtering, even if you save the view. So, again, it is not a move.

Added Variables Not Filling Out When Merging Files

I have two data sets that I want to Merge on the variable Survey ID.
The first data set can have one survey ID listed more than once.
The second data set will only have unique IDs.
I chose Data-->Merge Files-->Add Variables-->Join on Survey ID.
But, I can see in my exported data that whenever a survey ID repeated in the first data set, it didnt merge properly with the second data set.
See below for what happened:
So Country and Segment came from the second data set. But you can see that on the second instance of ID 1013304, it's not filling in. I want that blank row to also say Country: Japan, Segment: C.
How can I achieve this?
Thanks! (:
It may be your problem is not sorting both files in advance. In any case this should work for you:
*open the file with unique data.
sort cases by Survey_ID.
dataset name unique_data.
*open second file.
sort cases by Survey_ID.
dataset name full_data.
match file /file=* /table=unique_data/by Survey_ID.
exe.

Visual Studio REST API Iteration and Area ID's

I am working with the VSO REST API and have a question on how Iteration and Area ID's are assigned. Specifically, why is it when I assign a work item to the root Iteration or Area the ID that is returned for the WIT is not returned when I query the classification nodes?
For example, imagine I have this hierarchy when I query /DefaultCollection/my project/_apis/wit/classificationnodes?$depth=2
My Project: id=1234
Area 1: id=5678
Area 2: id= 9012
And I then query for a work item using /DefaultCollection/_apis/wit/workItems/1?$expand=all
If the work item is in Area 1 or Area 2, the System.AreaId field is as expected (5678 and 9012, respectively). However, if I assign the work item to My Project, the System.AreaID is some value that is not included when I query for all classification nodes. There appears to be some kind of relationship between the ID's as they are serial (e.g. the ID returned by the classification node query is 1232 for the area and 1233 for the iteration), but I can't seem to find a way to query to get the actual ID returned by the work item query.
In fact, not only is the ID returned for a work item not present when I query for all classification nodes, if I assign the work item to both the root iteration and area, the ID returned for both fields is the same value that is not included in the classification node query.
What I need is a way to look at a work item and figure out the area and iteration it belongs to. I could probably do something with the path field strings that are returned, but that seems error prone since users can change them.
****Edit****
The above appears to be a bug in the REST API, but for anyone who comes across this post there is a way to get a usable iteration ID by the path string. Structure your REST call like so:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/Release 1/Sprint 1 (etc.)
I have never done this with ID. I only use the path. In the classification service you can get the node by path easily enough.
For example, using the REST API - you can access this url to get the data about a specific iteration:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/[Release X]/[Sprint Y]
Note that trying to access the default iteration path (the project name instead of a specific iteration) will return an error:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/[Project Name]
will give :
{"$id":"1","innerException":null,"message":"VS402485: The node name is not recognized: [Project Name]","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingTreeNodeNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"WorkItemTrackingTreeNodeNotFoundException","errorCode":0,"eventId":3200}
So if you do batch work, you have to filter those before querying the api.
There are three ways of identifying an Area (everything I post equally applies to Iterations also). The Path (string), the ID (int) and a Guid. each of them are used in different ways, and have different ramifications.
For example renaming an Area, does NOT change it's identity, therefore does not update a work item (the path returned for in a workitem is dynamic).
It is also possible to delete and recreate and identical path, but it will have a different ID.
The GUID is used primarily for the Excel Reports (such as are parent of the SharePoint portal)
Depending on how you want things to react determines the appropriate element to use.
I have not seen any issues with the ID that you mention, and if you could create a simple repro, I would be glad to look at it.
david(dot)corbin(at)dynconcepts(dot)com

Resources