Tag: saas

  • Lexoffice API notes

    Minimal invoice creation using the API.

    {
      "voucherDate": "2021-08-18T12:26:50.748Z",
      "address": {
        // if this is given the other fields become optional
        "contactId": "139bdad3-7786-43e2-acf0-8c3eaf0ee8c7"
      },
      "lineItems": [
        {
          "type": "service",
          "name": "Dienstleistungen",
          "description": "Beschreibung",
          "quantity": 5,
          "unitName": "Stunde",
          "unitPrice": {
            "currency": "EUR",
            "netAmount": 1,
            "taxRatePercentage": 19
          }
        }
      ],
      "totalPrice": {
        "currency": "EUR"
      },
      "taxConditions": {
        "taxType": "net"
      },
      "shippingConditions": {
        // the API documentation is wrong, the API only accepts: custom / none / text
        "shippingType": "none"
      },
      "title": "Rechnung",
      "introduction": "Ihre bestellten Positionen stellen wir Ihnen hiermit in Rechnung",
      "remark": "Vielen Dank für das entgegengebrachte Vertrauen"
    }
    
  • JIRA and Python

    I really came to hating JIRA with a passion. And now I have to create about 350 tickets.

    Naturally I don’t do this by hand. But using the JIRA API is kind of … hard, there is a Python library, but usage is rather sparsely documented, and this whole thing is just annoying as hell.

    Although when you did it, it’s quite simple. Here’s an example of how to create a ticket with due date and estimate set from a CSV file:

    from pprint import pprint, pformat
    from getpass import getpass
    
    import jira
    
    
    def do_shit():
        url = read("JIRA url:")
        username = read("JIRA username:")
        password = getpass("JIRA password:")
        jira_inst = jira.JIRA(url, basic_auth=(username, password))
    
        test = {
            "project":          {"key": "TEST"},
            "issuetype":        {"name": "Task"},
    
            "labels":           ["deleteme", "whatisthis"],
    
            "summary":          "woho",
            "description":      "wohooooo",
            "duedate":          "2017-11-11",
    
            "timetracking":    {"originalEstimate": "4d"},
        }
    
        created = jira_inst.create_issues([test])
        pprint(created)
    
    
    if __name__ == "__main__":
        do_shit()
    

    So simple.

  • TeamCity LDAP authentication with JumpCloud

    JumpCloud looks like a great service to use LDAP without using LDAP. And I have just managed to find an error in the documentation, precisely the file “ldap-config.properties.dist”.

    The working configuration is:

    # basic jumpcloud url
    java.naming.provider.url=ldap://ldap.jumpcloud.com:389/
    
    # search user for jumpcloud
    java.naming.security.principal=uid=BIND_USER_NAME,ou=Users,o=ORG_ID,dc=jumpcloud,dc=com
    java.naming.security.credentials=BIND_USER_PASSWORD
    
    # unix ldap seems to use uid as username - see https://is.gd/dBPegr
    teamcity.users.login.filter=(uid=$capturedLogin$)
    teamcity.users.username=uid
    teamcity.users.base=ou=Users,o=ORG_ID,dc=jumpcloud,dc=com
    

    Seems to work nicely, now comes the finetuning.