As per our discussion the following changes have been considered for the sw360 login hook.
From SW360 UI:
The login hook to update the organizations detail if it is empty in Liferay then, during the first login from the UI, it will update the Liferay organization to the default value as "SW360" and also it updates the couchdb department column.
From the Rest API:
From the rest endpoints during the user authentication if the department is null/empty in couchdb then it updates the department column in couchdb with the default value as "SW360".
Description
Create a login hook for the sw360 user if the Organization value is empty/null in CouchDB as well as in Liferay.
Steps followed and expected result
Describe the steps followed by you and your expected results after following the steps.
Screenshots
If applicable, add screenshots to help explain your problem.