It's all about the answers!

Ask a question

DNG - RM Extension iterate over artifacts in module


Sean F (1.3k241144) | asked Aug 11 '18, 12:58 p.m.
edited Aug 11 '18, 12:59 p.m.
I am trying to iterate over the artifacts in a module (so I can follow links from each artifact) using an RM extension.
I open the module so it is the current artifact at the start of the script then :-


RM.Client.getCurrentArtifact(function(ref)
{
    RM.Data.getContentsStructure(ref, function(opResult)
    {
        opResult.data.forEach(function(row)
        {
            RM.Data.getLinkedArtifacts(row, [], function(linksResult) // OPERATION_BAD_REQUEST
            {
                // get data from linked artifacts       
            });
        });
    });
});

 I get a OPERATION_BAD_REQUEST from the call to RM.Data.getLinkedArtifacts(row, [], function(linksResult) when I do this because the 'row' parameter is apparently not an artifact.

The operation opResult.data.forEach does not seem to loop through artifacts. Is there any way to loop through the artifacts in a module and get a reference to each artifact in turn that can be used successfully with RM.Data.getLinkedArtifacts?

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.