I would like to create a mapping file, supported by a snippet, so that I can import every requirement in codebeamer to medini as goal. I always fail with the js file. could you give me an example, how I can do this?
Sven
Hello Sven,
could you be a bit more precise on the use case? In fact, you do not necessarily need a "selector" JS script to map requirements to Goals. You only need that if you want to map some requirements to requirements and others to goals for example. Anyway, there are currently only 3 hoosks:
Just an example which dump each element that is imported to script console:
<typeMappings mediniType="SafetyRequirement" mappedType="item" mappedSelector="/* $EXPERIMENTAL$ */ load('codebeamer.js'); dump(element); true;"> <attributeMappings mediniAttribute="name" mappedAttribute="Summary"/> <attributeMappings mediniAttribute="description" mappedAttribute="Description"/> </typeMappings>
Regards
Jan
Hi Jan the usecase:
we have a codebeamer tracker, which contains safety-goals. These Goals are structured via Headings. If I just import the codebeamer tracker as "goals", only the first hierarchy is imported.
What I want is:
import only elements of "requirements" type as goals.
Hm, this is tricky I guess. IMHO you have 2 issues here:
The first problem is caused by the fact that medini's MM is limiting safety goals to a flat list, no sub-structure. So you need to force elements to root by using
onInit="options['FORCE_AT_ROOT'] = true;"
in the mapping definition.
Second, you need a filter that excludes anything that is not a requirements. You have to use a mapped selector, so
mappedSelector="getReferenceFieldValue('Type', ChoiceFieldValue) != 'Folder';"
in the type mapping. This is pseudo code here, wont work as such as you don't have the function getReferenceFieldValuein your place. How do you distinguish headings from requirements? I mean via which field in Coeebeamer?
getReferenceFieldValue
Hi Jan,
we are using the "item type" field. If it is a requirement, we can map it as goal. All others are headings or descriptions.
Sven, is the field really named "Item Type" or just "Type"? Anyway, either way, the mentioned selector should work for you:
mappedSelector="getReferenceFieldValue('Item Type', ChoiceFieldValue) == 'Requirement';"
However, the function getReferenceFieldValue is not available by default but need to be implemented in a companion script. I have no access to hat script right now but will drop it here early next week. Stay tuned.