This article provides an example of a configurable Grid that enables users to create issues in a specified Project for all test cases where the Test Case Status is "Not OK". For details on the SystemWeaver Script Language elements utilized in the example, see the application Help.


Example Meta Model


Example Data 


Project

The project must have a Project SID value. You can create and/or obtain this via the Setup>General menu in the project.


To set issue attribute values when the issue(s) are created, the attribute type(s) must already exist in the project. In the example provided, the item attribute TDAT will be mapped to the issue attribute DUTO.


Item Attribute


Issue Attribute



Example Configuration 

<Grid>
	<Parameters>
		<Parameter caption="Test Suite" name="testSuite" as="Item" hintContextPath="ISES">
			<Values>
				<ForEachPathReference path="ISES">
					<AddValue/>
				</ForEachPathReference>
			</Values>
		</Parameter>
	</Parameters>
	
	<Options>
		<CellAutoHeight/>
		<Grouping/>
		<Filtering/>
	</Options>
	
	<Variable name="test" as="Item" select="."/>
	<Variable name="testCasesNotOk" as="[Item]" select="TopNode/ISSP/ITEC[@PTCS = 'Not OK']/item::[not /issueref::IR]"/>
	
	<ActionBindings>
	
		<ActionBinding columnIds="issue" actionId="AddIssuesToNotOkTestCases" caption="Add issues to all NotOk test cases" confirmationDialog="true">
			<WithParam name="test" select="$test"/>
			<WithParam name="testCasesNotOk" select="$testCasesNotOk"/>
		</ActionBinding>
		
	</ActionBindings>
	
	<Actions>
	
		<Action id="AddIssuesToNotOkTestCases">
			<Parameter name="test" as="[Item]"/>
			<Parameter name="testCasesNotOk" as="[Item]"/>
			<Log>--- #{? $test.Select(@TDAT)}</Log>
			<ForEach select="$testCasesNotOk">
				<Item id="IT_#{Handle}" match="."/>
				<Issue id="IS_#{Handle}" project="CMS" issueType="Issue" assignedTo="bashar" iteration="#{? if true then 'Iteration 1' else ''}" status="Started" name="Review #{? .}">
					<Attribute sid="DUTO" value="#{? $test.Select(@TDAT.Format(''))}"/>
				</Issue>
				<IssueObjRef refType="IR" issue="IS_#{Handle}" obj="IT_#{Handle}" remove="true"/>
			</ForEach>
		</Action>
		
	</Actions>
	
	<Columns>
		<TextColumn caption="#" width="25" objectName="testCase">#{Part.PartNo}</TextColumn>
		<ItemNameColumn caption="Test Case Name" icon="true" width="200" objectName="testCase"/>
		<ItemVersionColumn caption="TC Version" width="25" objectName="testCase"/>
		<NodeAttributeColumn id="tCStatus" caption="TC Status" readOnly="False" width="75" type="PTCS" objectName="testCase"/>
		<NameColumn id="issue" caption="Issue" readOnly="true" width="200" objectName="Issue"/>
		<IssueIdColumn caption="Issue Id" objectName="Issue" width="100"/>
		<IssueStatusColumn caption="Issue Status" objectName="Issue" width="100"/>
		<IssueAttributeColumn caption="Due To" project="CMS" type="DUTO" readOnly="False" objectName="Issue" width="100"/>
		<AssignedToColumn caption="Assigned To" objectName="Issue" width="100"/>
	</Columns>
	
	<Context name="TestContext">
		<AddParts owner="main" sid="ISSP" part="TestToTestSpec" defobj="TestSpec" nodes="true"/>
		<AddParts owner="TestSpec" sid="ITEC" part="SpecToTestCase" defobj="TestCase" nodes="true"/>
		<AddParts owner="TestCase" sid="ITRQ" part="TestCaseToRequirement" defobj="Requirement"/>
		<AddParts owner="main" sid="IRTS" part="TestToTestSystemPart" defobj="TestSystem"/>
		<AddParts owner="main" sid="ISSU" part="TestToSUTPart" defobj="SUT"/>
		<AddParts owner="p2" sid="ISES" part="Test" defobj="main"/>
	</Context>
	
	<ForEachInContext name="TestContext" group="main">
		<ContextGoNodes>
			<ContextGoForward part="TestToTestSpec">
				<ContextGoForward part="SpecToTestCase">
					<RowObject name="testCase">
						<Row>
							<ContextGoItem>
							    <ForEach select="/issueref::IR">
								  <RowObject name="Issue"/>
							    </ForEach>
							</ContextGoItem>
						</Row>
					</RowObject>
				</ContextGoForward>
			</ContextGoForward>
		</ContextGoNodes>
	</ForEachInContext>
</Grid>


Example Result  

Users can right-click anywhere in the Issue column and select the action: 


The Execute pop-up will display (the confirmationDialog="true" is optional and can be removed). 


Issues are created per the <Issue> settings. 



Learn more about configuring Actions and ActionBindings in the application Help.