We have Dual User Identification turned on and it works as expected. Since we have the config set as “If set to “User ID” – the ‘Display User ID’ Preference should be set to “NO”, the user values in SDK comes back as lastname, firstname. Any ideas how to get to User object ?

Example: Lets say we have Change Order: ECO-001. The creator is James Bond. In UI the creator attribute displays “James Bond”. In SDK when we get values for ECO its comes back with James Bond for creator. 
The issue arises when the First name and Last name is not unique enough ? So when we need to send an email notification based on an ECO function we want to ensure we send it to the correct user ?Any suggestions?

Add Comment
2 Answer(s)

Hi,

You can try a hybrid approach of interacting with db and fetching the value If your requirement is to get change analyst and originator mail id only. . Following below is the flow.: –

//Declare a resultSet and pass your change number to the following method..
ResultSet resultSet = getmailIDs(change_number);

//Try retrieving as follow :
        while (resultSet.next()) {
            To_Mail_CA = resultSet.getString(1);
            To_Mail_Originator = resultSet.getString(2);
            }

////This is the body of ur mail id

    private static ResultSet getmailIDs(String Change_Num) throws APIException, SQLException {
        Connection conn = null;
        PreparedStatement psmt = null;
        ResultSet resultSet = null;
        conn = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD);
        psmt = conn.prepareStatement(
                “Select a.email,a1.email from Change c Inner Join AgileUser a on a.id = C.OWNER Inner Join AgileUser a1 on a1.id = c.Originator where Change_Number =?”);
        psmt.setString(1, Change_Num);
        resultSet = psmt.executeQuery();
        return resultSet;
    }

Regards,
Arif

Agile Angel Answered on March 19, 2018.
Add Comment

Arif – Appreciate your time and support. I was thinking along the same lines as the dB approach but solved it by getting the Change object and getting the cell value of the CA/Owner since its an IAgileList value and casting it as an IDataObject. Finally I get the email from :

ICell cell = doc.getCell(sowner);
ownerEmail=value1.getValue(UserConstants.ATT_GENERAL_INFO_EMAIL).toString();

Agile User Answered on March 19, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.