Main Content

addComment

Class: slreq.Justification
Namespace: slreq

Add comments to justifications

Syntax

newComment = addComment(jt,myComment)

Description

newComment = addComment(jt,myComment) adds a comment, myComment, to the justification jt.

Input Arguments

expand all

Justification, specified as an slreq.Justification object.

Comment text to add to the requirement, specified as a string scalar or character vector.

Output Arguments

expand all

New comment data, returned as a structure containing these fields:

Name of the individual or organization who added the comment, returned as a character vector.

Date that the comment was added, returned as a datetime object.

Comment revision number, returned as an int32 object.

Comment text, returned as a character vector.

Examples

expand all

This example shows how to add comments to justifications.

Load the requirement set crs_req_justs.

rs = slreq.load("crs_req_justs");

Get a handle to the first justification in the requirement set.

jt = find(rs,Index=5);

Add a comment to the justification.

newComment = addComment(jt,"My new comment.");

Tips

  • To add comments to requirements, use the addComment method of slreq.Requirement. To add comments to referenced requirements, use the addComment method of slreq.Reference. To add comments to links, use the addComment method of slreq.Link.

Alternative Functionality

App

You can also add a comment by using the Requirements Editor. Select a justification and, in the right pane, under Comments, click Add Comment.

Version History

Introduced in R2018b