Hello Jan,
In FMEA and also on the Hazardslevel, I would like to create a column where I would like to get the name ofthe project (project name from item definition) How can I do that ?
Hi Abdoul,
so the project name is a profile property for "Item Definition"? Is it ensured there is only one Item Definition in the project?
in that case the following profile property should do it:
var item = finder.findByType(Metamodel.hazard.PlainItem, true).asArray()var result = item[0].user_project_name;result
user_project_name would be the respective profile property of the item definition.
Thanks Eckhardt, You can use .first() on the finder result to make it a but smaller:
var item = finder.findByType(Metamodel.hazard.PlainItem, true).first();item ? item.user_project_name : "<undefined>";
Happy Scripting
Jan
Hello Eckhardt and Jan,
Thank you for the solution. This helps me to setup a column in medini to generate a title per line with generic text like :
VHL-HARA-Project-name-requirement Id
var item = finder.findByType(Metamodel.hazard.PlainItem, true).asArray()
var prjctName= item[0].name;
array = new Array();
if(self.identifier!=undefined){
array.push("VHL_HARA");
array.push(prjctName);
array.push(self.identifier);
}
array.join("_")
Best regards,
Abdoul
Good to hear that Abdoul, just one remark: just make sure to check the value of the variable item (similar like Jan proposed) before accessing it - it may be undefined resulting in an error message otherwise.
Eckhardt