It is entirely possible to set up Jira so that a subtask may remain open, while the parent task is closed. This effectively creates orphan subtasks, not connected to any open issue or ticket.

Identifying these is a matter of first identifying all subtasks, and then checking the status of both the subtask and its parent.

We first identify all subtasks for a given project by invoking a service context, and running some JQL against the Jira instance:

 import com.atlassian.jira.bc.filter.SearchRequestService
import com.atlassian.jira.issue.search.SearchRequest
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.jira.bc.JiraServiceContext
import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.issue.label.LabelManager

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def issueManager = ComponentAccessor.getIssueManager()
def searchService = ComponentLocator.getComponent(SearchService)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def searchManager = ComponentLocator.getComponent(SearchRequestService)
def contextManager = ComponentLocator.getComponent(JiraServiceContext)
def searchRequest = ComponentLocator.getComponent(SearchRequest)
def labelManager = ComponentLocator.getComponent(LabelManager)



JiraServiceContextImpl serviceCtx = new JiraServiceContextImpl(user);
//Declare a search context using the logged-in user

def queryParser = ComponentAccessor.getComponent(JqlQueryParser)
//Declare a parser to handle the JQL query

def query = queryParser.parseQuery('project = "<project name>" ')
//Define the JQL query.  In this instance we're returning all issues under a given project

def search = searchService.search(user, query, PagerFilter.getUnlimitedFilter())
//Define a search, using all the pieces defined 

This is part three of my series on using Python to connect to the Twitter API.

Imagine for a moment that you had a specific vision for your Twitter account.  A vision of balance, and harmony.  What if you only followed people who also followed you?  Whether or not you want to curate your Twitter experience in this transactional way is entirely up to you. It’s your account!

We can do that with Python. As always, replace the placeholders with your own account credentials.  See Part One of this series if you’re not sure how to do that. 

Let’s take a look at the code required to do this:

 import tweepy

consumerKey = "<>"
consumerSecret = "<>"
accessToken = "<>"
accessTokenSecret = "<>"

auth = tweepy.OAuthHandler(consumerKey, consumerSecret)
auth.set_access_token(accessToken, accessTokenSecret)

#Call the api 
api = tweepy.API(auth,wait_on_rate_limit=True)

#define two empty lists
followers = []
following = []
  
#Get the list of friends
for status in tweepy.Cursor(api.get_friends,count=200).items():
    #Add the results to the list
    following.append(status.screen_name)

#get the list of followers
for status in tweepy.Cursor(api.get_followers,count=200).items():
    #Add the results to the list
    followers.append(status.screen_name)
    
#compare the lists and take action
for person in following:
    if person not in followers:
        api.destroy_friendship(screen_name=person)
        print("Unfollowed " + person)
         

As

Introduction

There are a great number of things that you might want to do with Twitter, for which the web or mobile clients don’t have facilities.  For example, you might want to run a script that automatically thanks anyone who follows you.  Or you might want to run a script that Likes any comment that someone adds to your post. 
It is worth noting that Twitter is extremely strict when it comes to automated actions around followers.  For example, it’s entirely possible to scrape the follower list of large accounts, and write a script to automatically follow all of those people. That would conceivably get you a large number of followers, and when you were done you could just write anther script to unfollow anyone who didn’t follow you back.   I promise that the Twitter API will pick up on what you’re doing, and put you in Twitter Jail.  Don’t do that.
In this post we’ll examine how to make a basic connection to the Twitter API, using Python and Tweepy.    We’ll investigate one of the errors you might encounter, and discuss the pagination of the results that the API returns. The example we’re using will return a list

Introduction

A great deal of the available information regarding the use of Twitter and Python is outdated. The Twitter API has undergone several major revisions in the last few years, and many of the available tutorials now only lead to frustration.

Not only has the API undergone major revisions, but there are multiple supported versions of the API.  Some methods referenced by online tutorials will only work with certain other methods!

My hope for this series is to provide a clear and concise tutorial for connecting to the Twitter API using Tweepy and Python.

In order to connect to the Twitter API, your account must be provisioned for Developer access.  This is a free service, at the basic level, but does require additional setup.  That will be the focus of this first blog post.

Resources Required

You will need:

  • A Twitter account with a verified email address and verified phone number
  • Developer access to that account
  • A Python IDE (I use Spyder)
  • Tweepy

This post focuses solely on gaining Developer access, and assumes you already have the account.

The Setup

While I intend for this tutorial to be quite detailed, I trust that you can handle signing up for a

Introduction

I’ve been considering pivoting my career toward developer advocacy.  I’m a decent developer with great customer service skills, and I can see myself doing well in such a position.   In order to do that, I need to have a stronger idea of what I believe the role will entail.  When I’ve established that, I’ll know which jobs to apply for.

 In this post, I am attempting to answer two questions: what do developers actually do, and how can an advocate help them do that?

What is the point of a developer?

In previous blog posts I have discussed the role of Knowledge Management in an organization. That role is the consistent application of the organization’s ideology.   Put it another way, the organization has a certain way it needs to run, and to think about things, and Knowledge Management helps with that process.

So, what is the role of the developer?  When we start talking about developers, we quickly move from a very general business context to a much more specific one.   Software can do many things, but in a lot of ways a developer is a developer.  The offhand answer is, of course, that a developer develops software.  This

Knowledge Management has an active role in shaping the ongoing ideology that an institution develops.  As the curators of the information that ultimately informs ideology, the Knowledge Management team has a responsibility to be aware of not only their privilege, but also of the historic unequal privilege afforded to marginalized groups found within an organization.

Knowledge is power, and access to knowledge has long been wielded as a weapon by the ruling class.  For many years the Bible was only available in Latin. This was because the ruling class (the clergy) were the only people who could read Latin.  They therefor were the only ones able to interpret the bible, giving them full authority over the working class as the voice of God on earth.

In the middle of the 19th century, literacy tests were given to voters.  As the literacy rates of marginalized groups such as African Americans was low, this effectively disenfranchised large groups of voters. 

These are historic examples, but limited access to information continues to be used to shut out or keep down marginalized groups.   The Freedom of Information act was passed in the USA in 1967, and in theory should have allowed ordinary citizens

Consider, if you will, a non-technical member of staff.  They have been tasked with writing promotional materials for your organization’s new software offering.  In order to do so, they will need to speak the technical capabilities and nuances of the product.  They have entered… the Developer Zone.

Rod Serling may be gone, but his legacy lives on wherever there is a disconnect between two worlds. In our case, the disconnect is between technical and non-technical persons.  The challenge is to connect those groups without alienating either one; non-technical people may find themselves overwhelmed with jargon, and technical staff may find it difficult to dedicate time to teaching nontechnical staff about the nuances of a product.

Knowledge Management can be the bridge between these worlds.  Let us examine.

The goal of Knowledge Management is not simply to collect data; as we have previously discussed, the role of Knowledge Management is the consistent and considered application of information and ideology, in keeping with the ultimate goals of an organization.

When two different groups need to exchange information, Knowledge Management can act as a mediator.   A robust Knowledge Management system allows for the asynchronous transfer of information; the two groups need not

How much does your organization value the ability to say, “I don’t know”? Is wilful ignorance a core tenet of the institutional ideology to which your employees are subject?

The advantage of an effective Knowledge Management strategy is that as issues arise, the solutions to those issues may be catalogued.  By resolving the issue and cataloguing the solution, the issue becomes an asset. The ability to solve the problem becomes part of the institutional memory of the organization. That ability may be monetized or harnessed, and the wheels of capitalism may continue to turn.

The disadvantage of an effective knowledgebase is that the organization no longer gets to claim ignorance of that particular issue. By cataloguing the ability to address an issue, an institution lays claim to some responsibility for it.   In other words, it’s harder to pass the buck when the tools to address the issue are at hand.

This is a cynical viewpoint, but business is cynical.  Let us consider an example.

In the context of a business that relies on volume, speed is king.  One such example is a low-level call centre.   Employees must meet the minimum standard to address a customer’s issue, in such a way

The ultimate goal of Organizational Knowledge Management is not to collect, store, and curate information.  Those tasks are a means to the end with which Knowledge Management ultimate concerns itself:  application of ideology.

All industries benefit from a focus on consistency, in both material and conceptual spaces. Knowledge Management is the facilitation of clean, ideologically consistent information. The ultimate fate of that information is the prerogative of the rest of the organization; Knowledge Management is only concerned with how the information is perceived and presented.

All effective organizations have a consistent ideology by which they operate.   Effective ideology is symptomatic of the deliberate fostering of a workplace culture, which manifests as a central source of truth (i.e. a knowledgebase).   Consistent information is the means by which all organizations may move and grow in the same direction; inconsistent information causes organizations to move in different directions, resulting in stagnation or inefficiency.

Knowledge Management is ultimately the application of a consistent ideology at an organizational level. When policy dictates that an organization has a single source of truth, the job of Knowledge Management is to ensure the consistent application of a workplace’s culture and ideology. While Knowledge Management is the application

 

I worked in an inbound call centre for three years.  I worked as a Level 1 analyst, meaning that the work I was doing was intended to resemble all of the previous calls that I’d taken. In other words, I wasn’t paid to come up with creative or unusual solutions.

 In that time, I learned that there were three ways that clients could quickly become upset:

  • Getting the runaround. There are few ways to upset a call centre client more quickly than causing them to feel that they are being shuffled around between people who don’t know the answer, or don’t care about their issue.
  • Getting the wrong answer. Clients rarely got upset when they were told by a rep “I’m not sure, I’ll have to check on that”.   What would upset them is if the representative confidently presented them with the wrong answer, and the client had to call back later to rectify the issue.
  • Getting inconsistent answers. Possibly even more so than getting the wrong answer, clients got very upset when they were told different things by different phone reps.   This was often the result of the phone rep working from memory or making assumptions.

All three