src/scripts/content/zammad.js
/**
 * We take the client name as project if one is found and append the organization if the client is assigned
 * @returns {string}
 */
We take the client name as project if one is found and append the organization if the client is assigned
@returns {string}
We take the client name as project if one is found and append the organization if the client is assigned @returns { string }
function projectSelector () {
  const client = document.querySelectorAll('[data-tab="customer"] [title="Name"]');
  const organization = document.querySelectorAll('[data-tab="organization"] [title="Name"]');
  let clientName = '';
  if (client.length === 1) {
    clientName = client[0].textContent.trim();
  }
  if (organization.length === 1) {
    clientName += ' (' + organization[0].textContent.trim() + ')';
  }
  return clientName;
}
function projectSelector ( ) { const client = document . querySelectorAll ( '[data-tab="customer"] [title="Name"]' ) ; const organization = document . querySelectorAll ( '[data-tab="organization"] [title="Name"]' ) ; let clientName = '' ; if ( client . length === 1 ) { clientName = client [ 0 ] . textContent . trim ( ) ; } if ( organization . length === 1 ) { clientName += ' (' + organization [ 0 ] . textContent . trim ( ) + ')' ; } return clientName ; }
We take the client name as project if one is found and append the organization if the client is assigned
 @returns {string}
We take the client name as project if one is found and append the organization if the client is assigned @returns { string }