PageRenderTime 85ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/components/camel-jira/src/main/docs/jira-component.adoc

https://gitlab.com/matticala/apache-camel
AsciiDoc | 122 lines | 87 code | 35 blank | 0 comment | 0 complexity | fefeb56944521f9355f91771f98c857f MD5 | raw file
  1. [[jira-component]]
  2. == JIRA Component (deprecated)
  3. *Available as of Camel version 2.15*
  4. The JIRA component interacts with the JIRA API by encapsulating
  5. Atlassian's https://marketplace.atlassian.com/plugins/com.atlassian.jira.jira-rest-java-client[REST
  6. Java Client for JIRA]. It currently provides polling for new issues and
  7. new comments.  It is also able to create new issues.
  8. Rather than webhooks, this endpoint relies on simple polling. Reasons
  9. include:
  10. * Concern for reliability/stability
  11. * The types of payloads we're polling aren't typically large (plus,
  12. paging is available in the API)
  13. * The need to support apps running somewhere not publicly accessible
  14. where a webhook would fail
  15. Note that the JIRA API is fairly expansive.  Therefore, this component
  16. could be easily expanded to provide additional interactions.
  17. Maven users will need to add the following dependency to their pom.xml
  18. for this component:
  19. [source,xml]
  20. ---------------------------------------
  21. <dependency>
  22. <groupId>org.apache.camel</groupId>
  23. <artifactId>camel-jira</artifactId>
  24. <version>${camel-version}</version>
  25. </dependency>
  26. ---------------------------------------
  27. ### URI format
  28. [source,text]
  29. -------------------------
  30. jira://endpoint[?options]
  31. -------------------------
  32. ### JIRA Options
  33. // component options: START
  34. The JIRA component has no options.
  35. // component options: END
  36. // endpoint options: START
  37. The JIRA endpoint is configured using URI syntax:
  38. ----
  39. jira:type
  40. ----
  41. with the following path and query parameters:
  42. ==== Path Parameters (1 parameters):
  43. [width="100%",cols="2,5,^1,2",options="header"]
  44. |===
  45. | Name | Description | Default | Type
  46. | *type* | *Required* Operation to perform such as create a new issue or a new comment | | JIRAType
  47. |===
  48. ==== Query Parameters (9 parameters):
  49. [width="100%",cols="2,5,^1,2",options="header"]
  50. |===
  51. | Name | Description | Default | Type
  52. | *password* (common) | Password for login | | String
  53. | *serverUrl* (common) | *Required* URL to the JIRA server | | String
  54. | *username* (common) | Username for login | | String
  55. | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
  56. | *delay* (consumer) | Delay in seconds when querying JIRA using the consumer. | 6000 | int
  57. | *jql* (consumer) | JQL is the query language from JIRA which allows you to retrieve the data you want. For example jql=project=MyProject Where MyProject is the product key in Jira. | | String
  58. | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
  59. | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. | | ExchangePattern
  60. | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
  61. |===
  62. // endpoint options: END
  63. ### JQL:
  64. The JQL URI option is used by both consumer endpoints.  Theoretically,
  65. items like "project key", etc. could be URI options themselves.
  66.  However, by requiring the use of JQL, the consumers become much more
  67. flexible and powerful.
  68. At the bare minimum, the consumers will require the following:
  69. [source,text]
  70. --------------------------------------------------------------
  71. jira://[endpoint]?[required options]&jql=project=[project key]
  72. --------------------------------------------------------------
  73. One important thing to note is that the newIssue consumer will
  74. automatically append "ORDER BY key desc" to your JQL.  This is in order
  75. to optimize startup processing, rather than having to index every single
  76. issue in the project.
  77. Another note is that, similarly, the newComment consumer will have to
  78. index every single issue *and* comment in the project.  Therefore, for
  79. large projects, it's *vital* to optimize the JQL expression as much as
  80. possible.  For example, the JIRA Toolkit Plugin includes a "Number of
  81. comments" custom field -- use '"Number of comments" > 0' in your query.
  82. Also try to minimize based on state (status=Open), increase the polling
  83. delay, etc.  Example:
  84. [source,text]
  85. ----------------------------------------------------------------------------------------------------------------------------------------------
  86. jira://[endpoint]?[required options]&jql=RAW(project=[project key] AND status in (Open, \"Coding In Progress\") AND \"Number of comments\">0)"
  87. ----------------------------------------------------------------------------------------------------------------------------------------------