title: Adding Organisation and Organisation Title to a new contact programmatically
body: <p>I am trying to use the contacts API to add contact information which includes the users Organisation and their job title. </p>
  
  <p>I am using the following code in order to perform the insert. </p>
  
  <pre><code> String contactName = xmlProcessor.getSingleParameterValue("ContactName");
  
              if (xmlProcessor.doesSingleElementExist("CompanyName")) {
                  company = xmlProcessor.getSingleParameterValue("CompanyName");
              }
              if (xmlProcessor.doesSingleElementExist("CompanyTitle")) {
                  companyTitle = xmlProcessor.getSingleParameterValue("CompanyTitle");
              }
              String phoneNumber = xmlProcessor.getSingleParameterValue("PhoneNumber");
  
              ContactInformation.PhoneNumberType phoneNumberType = ContactInformation.PhoneNumberType.valueOf(xmlProcessor.getSingleParameterValue("PhoneNumberType"));
              String email = xmlProcessor.getSingleParameterValue("Email");
              ContactInformation.EmailType emailType = ContactInformation.EmailType.valueOf(xmlProcessor.getSingleParameterValue("EmailType"));
              String address = xmlProcessor.getSingleParameterValue("Address");
              ContactInformation.AddressType addressType = ContactInformation.AddressType.valueOf(xmlProcessor.getSingleParameterValue("AddressType"));
  
              ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();
              int rawContactID = ops.size();
  
              //Create the Raw ID
              ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
                  .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)
                  .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null)
                  .build());
  
              // Adding insert operation to operations list
              // to insert display name in the table ContactsContract.Data
              ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                  .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                  .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
                  .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, contactName)
                  .build());
  
              if (company != null) {
                  //Adding insert operation to operations list
                  //to insert organisation name
                  ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                          .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                          .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE)
                          .withValue(ContactsContract.CommonDataKinds.Organization.COMPANY, company)
                          .build());
              }
  
              if (companyTitle != null) {
                  //Adding insert operation to operations list
                  //to inset organisation title
                  ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                          .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                          .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE)
                          .withValue(ContactsContract.CommonDataKinds.Organization.JOB_DESCRIPTION, companyTitle)
                          .build());
              }
              // Adding insert operation to operations list
              // to insert Mobile Number in the table ContactsContract.Data
              ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                  .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                  .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
                  .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phoneNumber)
                  .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, getPhoneTypeInteger(phoneNumberType))
                  .build());
  
              if (!email.equals("")) {
                  // Adding insert operation to operations list
                  // to insert Email
                  ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                      .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                      .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)
                      .withValue(ContactsContract.CommonDataKinds.Email.ADDRESS, email)
                      .withValue(ContactsContract.CommonDataKinds.Email.TYPE, getEmailTypeInteger(emailType))
                      .build());
              }
              if (!address.equals(""))
              {
                  //Insert the address
                  ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
                          .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactID)
                          .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)
                          .withValue(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, address)
                          .withValue(ContactsContract.CommonDataKinds.StructuredPostal.TYPE, getAddressTypeInteger(addressType))
                          .build());
  
              }
  
              context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
  </code></pre>
  
  <p>The insert is mainly working OK and the organisation name appears to be OK but the job title doesn't seem to be referencing the right thing. I have used Organisation.JOB_DESCRIPTION and Organisation.TITLE. </p>
  
  <p>When I add a contact manually with the company name and job title the contacts name, their company and job title are shown in the action bar when you go into the view the contact details. However when I add a contact via the code above, I can see the contacts name and their company but not their job title so I think I must be adding it to the wrong place. </p>
  
  <h2>Clarifications</h2>
  
  <p>In the screenshot below it shows what information I want to add from the people app, The Name, The Organisation and the Title. When these first text boxes have data in them this data is shown in the action bar when you view the contact. </p>
  
  <p><img src="https://i.stack.imgur.com/jDC37.png" alt="What data I am trying to include"></p>
  
  <p>When I add the contact via my app using the code above, the information is put in the first text box for name, the second contact for organisation and then the 5 text box for the job title so the action bar only shows the contact name and organisation. The below screenshot shows what I mean</p>
  
  <p><img src="https://i.stack.imgur.com/TeqYc.png" alt="What contact looks like after it has been added via my app"> </p>