Need universal session relevance inspector for `current console user`

The session relevance inspector current console user properly returns the correct bes user when used in the console, but it does not provide a correct result through the REST API and there is no equivalent alternative for the REST API.

It is very useful to be able to dynamically determine the current bes user from the context of a session relevance query so that you don’t have to hardcode a particular user, which would is much less than ideal.

An example use case is if you want to stop a user’s existing action automatically. Actions can only be stopped by the user who created the action, or a master operator. This means in most cases, if you want to automate the stopping of older actions, then it is only possible to do this for the current user’s actions.


Here is an example from the bes console:

Q: name of current console user
A: jgstew

Example using the REST API:

command: curl -k --user jgstew --data-urlencode relevance="name of current console user" https://_ROOT_SERVER_:52311/api/query

result:

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
        <Query Resource="name of current console user">
                <Result></Result>
                <Error>Singular expression refers to nonexistent object.</Error>
        </Query>
</BESAPI>

This should instead return: jgstew


Reference: https://developer.bigfix.com/relevance/reference/bes-user.html

RFE: http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=92159

3 Likes

I found a curious piece of session relevance that works, but I’m not sure it is supposed to.
I created a parameterized fixlet that uses session relevance in the Description tab to pull the currently logged-in BES Console username. I created a textbox with UIType “relevance”, and with “Values”: (names of bes console users).
Even though it’s a plural query, it only pulled my single user name. I verified that it worked for other console users as well. So I think this code would also work for REST API. It’s odd that asking for a plural only ever returns a singular value, but i’m not complaining.

1 Like

I think you’re having an issue with the concept of “console user”

If you’re going through REST you aren’t on the console so I’d expect that even “current console user” would return a nonexistent object return.

You are trying to basically get the answer to “who is evaluating this relevance” is that correct?

1 Like

Yes, I’m trying to get who is evaluating the relevance. I realize current console user doesn’t directly map to the concepts of the REST API evals, but I need an equivalent, and ideally one that would work in both places. REST API evals as well as in the Console. If it only works for one, then hopefully i can make a plural statement that will end up working for both.

I am already doing this in many of my fixlets/tasks, but it doesn’t work when trying to get the same info from the REST API directly, thus this enhancement request.

Did you actually file an RFE?

1 Like

I just submitted the RFE now: http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=92159

After getting past the issues below.

I just tried logging in to file an RFE and this is what I got:


Then I went through to the RFE submit process again, and got this:


Logging into IBM sites rarely ever actually works for me without clearing my browser cache or opening a private browsing session. Then, there are the times when the login works, but then it tells me the site is down for maintenance.