# Utils

The `MetadataUtils.groovy` file provides utility methods for getting Jenkins metadata for our shared Jenkins libraries.

## Usage

### getLastCompletedBuildStatus

`getLastCompletedBuildStatus` is a static NonCPS class method, which gets result of the last completed build for a given job.

```groovy
import com.sonymusic.MetadataUtils

def status = MetadataUtils.getLastCompletedBuildStatus(env.JOB_NAME)
```

## Method Details

### getLastCompletedBuildStatus

- **Parameters**:
  - `jobName`: The name of the global var to validate parameters for.
- **Returns**:
  - `hudson.model.Result` if the completed build has been found, otherwise `null`
