---
id: 6a1d9f98e819ed70a0e994de
title: "Challenge 332: Issue Triage"
challengeType: 28
dashedName: challenge-332
---

# --description--

Given a number of milliseconds since the last post on an issue, and the last message posted on the issue, determine what you should do with the issue according to these rules:

- If the last message is less than 7 days ago, return `"leave it"`
- If the last message is 7 or more days ago and its content contains `"bump"` (case-insensitive), return `"close it"`
- Otherwise, return `"bump it"`

# --hints--

`triageIssue(86400000, "Lets fix it")` should return `"leave it"`.

```js
assert.equal(triageIssue(86400000, "Lets fix it"), "leave it");
```

`triageIssue(1209600000, "still waiting")` should return `"bump it"`.

```js
assert.equal(triageIssue(1209600000, "still waiting"), "bump it");
```

`triageIssue(864000000, "bump")` should return `"close it"`.

```js
assert.equal(triageIssue(864000000,  "bump"), "close it");
```

`triageIssue(604800000, "Do we still want this?")` should return `"bump it"`.

```js
assert.equal(triageIssue(604800000, "Do we still want this?"), "bump it");
```

`triageIssue(604800000, "Bumping this")` should return `"close it"`.

```js
assert.equal(triageIssue(604800000, "Bumping this"), "close it");
```

`triageIssue(345600000, "I'll make a PR")` should return `"leave it"`.

```js
assert.equal(triageIssue(345600000, "I'll make a PR"), "leave it");
```

# --seed--

## --seed-contents--

```js
function triageIssue(ms, message) {

  return ms;
}
```

# --solutions--

```js
function triageIssue(ms, message) {
  const sevenDays = 7 * 24 * 60 * 60 * 1000;

  if (ms < sevenDays) return "leave it";
  if (message.toLowerCase().includes("bump")) return "close it";
  return "bump it";
}
```
