Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jira2slack

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jira2slack

Library to convert between JIRA markup and Slack markup

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
96
increased by104.26%
Maintainers
1
Weekly downloads
 
Created
Source

JIRA 2 Slack

npm version Build Status Coverage Status js-semistandard-style

Library to convert between JIRA markup and Slack markup

Example

const J2S = require('jira2slack');

const slackMD = J2S.toSlack('*This* _is_ -some- ^over^ ~formatted~ {{text}}');
// *This* _is_ ~some~ ^over -formatted- `text`

Conversions

Below are the conversions that are made:

Jira -> Slack

FormatJIRASlackDestructiveNotes
Headersh1. Heading\n *Heading*\nYesSlack doesn't support headers so library converts headers to bolded text on it's own line
Bold*bold**bold*Sometimes[1]
Italic_italic__italic_Sometimes[1]
Unordered List
* Bulleted List
** Indented more
* Indented less

• Bulleted List
..• Indented more
• Indented less
No[2]
Unordered Dash List- Bulleted Dash List
- Bulleted Dash List
- Bulleted Dash List
• Bulleted Dash List
• Bulleted Dash List
• Bulleted Dash List
YesAmbigious result from Bulleted list so reversal results in use of astericks
Ordered List# Numbered List
## Indented more
## Indented more
### Indented morer
### Indented morer
### Indented morer
## Indented more
# Indented less
1. Numbered List
..1. Indented more
..2. Indented more
....1. Indented morer
....2. Indented morer
....3. Indented morer
..3. Indented more
2. Indented less
No[1][2]
Monospaced{{code}}`code`No
Citations??citation??-- citation_YesSlack doesn't have citations, but I can replicate resulting format
Subscript~subscript~_subscriptYesSlack doesn't have subscript, but I denote it with a single underscore
Superscript^superscript^^superscriptYesSlack doesn't have superscript, but I denote it with a single carret
Strikethrough-strikethrough-~strikethrough~Sometimes[1]
Code{code}some code{code}```some code```YesSlack doesn't support specify the language, so that is removed during conversion
Quotes{quote}quoted text{quote}```quoted text```YesSlack does't support quoted text so the library uses preformmated ``` instead. This makes it impossible to convert back.
Pre-formatted Text{noformat}pre text{noformat}```pre text```YesSlack does't support no format text so the library uses preformmated ``` instead. This makes it impossible to convert back.
Unnamed Link[http://someurl.com]<http://someurl.com>No
Named Link[Someurl|http://someurl.com]<http://someurl.com|Someurl>No
Smart Link[http://someurl.com|http://someurl.com|smart-link]<http://someurl.com>YesSlack doesn't support smart links so we just strip it down to a regular link
Blockquotebq. This is quoted> This is quotedSometimesSlack doesn't support multi-line blockquotes (>>>) so those are ignored
Color{color:white}This is white text{color}This is white textYesSlack doesn't support colored text so it is removed.
Panel{panel:title=foo}Panel Contents{panel}Panel:
| foo |
| --- |
| Panel Contents |
YesSlack doesn't support panels, so the library attempts to replicate the format. This makes it impossible to convert back.
Table||heading 1||heading 2||
|col A1|col B1|
|col A2|col B2|
|heading 1|heading 2|
| --- | --- |
|col A1|col B1|
|col A2|col B2|
No

Notes

  1. JIRA supports spaces at the beginning and end of a markdown section (ex _ foo _) where Slack does not. To match the formatting, the library moves those spaces outside the formatter (ex _ foo _ becomes _foo_). While the result works in both JIRA and Slack, it is technically destructive.
  2. . indicate whitespace ( ), not a literal .

Slack -> Jira

FormatSlackJiraDestructiveNotes
Headers\n *Heading*\nh1. HeadingNo
Bold*bold**bold*No
Italic_italic__italic_No
Unordered List
• Bulleted List
..• Indented more
• Indented less

* Bulleted List
** Indented more
* Indented less
No[2]
Ordered List1. Numbered List
..1. Indented more
..2. Indented more
....1. Indented morer
....2. Indented morer
....3. Indented morer
..3. Indented more
2. Indented less
# Numbered List
## Indented more
## Indented more
### Indented morer
### Indented morer
### Indented morer
## Indented more
# Indented less
No[2]
Monospaced`code`{{code}}No
Citations-- citation_??citation??No
Strikethrough~strikethrough~-strikethrough-No
Code```some code```{code}some code{code}No
Unnamed Link<http://someurl.com>[http://someurl.com]No
Named Link<http://someurl.com|Someurl>[Someurl|http://someurl.com]No
Blockquote> This is quotedbq. This is quotedNo

Acknowledgments

Special thanks to Kyle Farris for his JIRA to Markdown library

Contributing

  1. Create a new branch, please don't work in master directly.
  2. Add failing tests for the change you want to make (if applicable). Run npm test to see the tests fail.
  3. Fix stuff.
  4. Run npm test to see if the tests pass. Repeat steps 2-4 until done.
  5. Update the documentation to reflect any changes.
  6. Push to your fork and submit a pull request.

Keywords

FAQs

Package last updated on 31 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc