Skip to content

Create new related workitem.  #278

@rbhole

Description

@rbhole

I want to create new related item NOT child item. My code as below,

if (parent.WorkItemType == "Risk") {
	if (parent.State == "Impacted")
	{
		var newChild = store.NewWorkItem("Issue");
		newChild.Title = "Issue " + parent.Title;
		newChild.State = "Identify";
		newChild.Description = "Issue created due to " + parent.Title + " Impacted";
		parent.Relations.Add(newChild);
		logger.WriteInfo("Issue added"); 
	}
}

I got error as below,

Errors in the rule file D:\Autocalculation\createWorkItem_Demo.rule:
(14,24): error CS1503: Argument 1: cannot convert from 'aggregator.Engine.WorkItemWrapper' to 'aggregator.Engine.WorkItemRelationWrapper'
[2023-03-29 16:27:08Z] Rule file is invalid
[2023-03-29 16:27:08Z] update.rule Failed!
[2023-03-29 16:27:08Z] Exiting with code 1

I gone through /scr from library... but unable to find out solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions