It's all about the answers!

Ask a question

RM.Event.subscribe(RM.Event.ARTIFACT_Selected...) does not recognize, if a requirement was selected via filter


Antje Rößle-Tuchel (2934) | asked Jun 12, 10:02 a.m.

I have implemented in my code the RM.Event.subscribe-function as followed:

let artRefs = RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, function(artRef){
        artRefsList=[]
        artRefsList.push(artRef)    
        //console.log(artRefsList)
        callback()
    })

It works fine, if I check the checkboxes of the artifact manually. But if I use the search possibilities of ERM, the founded artifact is selected from ERM - but the subscribe-event does not work. 
How can I solve this issue?

Alternatively I can get all selected artifacts via getElementsByClassName("row-checked"). This works but how can I get then the ArtRef, which I need? Is there a function available like ref.toUri() - only the other way round: uri.toRef()?

Every hint will be welcome!

One answer



permanent link
Davyd Norris (2.6k217) | answered Jun 12, 7:08 p.m.
The hint is in the event name - it will only fire if the artefact is SELECTED. It's got to be actually checked, not just highlighted.

It will fire if you create a filter or query and then select all the elements by using the check box in the top left of the column titles.

Comments
Antje Rößle-Tuchel commented Jun 14, 2:01 a.m.

If I search for an artifact by using the search option on the top the artifact is checked (checkbox is checked) and selected. (row-checked and row-selected). But the event is not fired? What is the reason behind?


Is there a function available like ref.toUri() - only the other way round: uri.toRef()?

Your answer


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.