-cd $WORKSPACE
-echo "Retrieving information from commit to push towards Opendaylight"
-project=$(git config --local remote.origin.url | awk -F "29418/opendaylight/" '{print $2}')
-message=$(git show -s --pretty=%B | grep -vi 'Signed-off-by')
+cd "$WORKSPACE"
+
+opendaylight_gerrit_base='git.opendaylight.org:29418'
+nordix_gerrit_rest='https://gerrit.nordix.org'
+
+echo >&2 "Collecting information about what and how to push towards OpenDaylight"
+
+# The git hash of the commit in the review this job runs on
+commit_hash="$GERRIT_PATCHSET_REVISION"
+
+# GERRIT_PROJECT is in the form of opendaylight/<opendaylight-project>
+opendaylight_project=$(echo "$GERRIT_PROJECT" | cut -d/ -f2- )
+
+# original way to get user name based on nordix id replaced by method below
+# Nordix Gerrit can map the email address of the user pushed the change to
+# the review to the Gerrit username of the account in Nordix Gerrit. This
+# should match with the Gerrit username in the OpenDaylight Gerrit.
+#username=$(
+# curl -s -H 'Accept: application/json' \
+# "$nordix_gerrit_rest/accounts/?q=email:$GERRIT_EVENT_ACCOUNT_EMAIL&o=DETAILS" \
+# | tee /dev/stderr | tail -1 | jq -r '.[0].username')
+
+# read user name from the commit details which allows nordix user name to be different to lfid